I am using facebook python Graph API. When I call put_object to write to the feed, it takes about 12-14 seconds to complete the call. When I run from the command line using curl with the same parameters, I get the answer back after 1.2 seconds.
I ran the profiler in python code and I see that it spends 99.5% of the time in socket.recv. I'm not sure if this is a problem with phdbook python sdk or something else.
I'm on python 2.6. I can see from facebook.py that it uses urllib.
file = urllib.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
Has anyone experienced a similar slowdown? Any suggestions would be highly appreciated.
source
share