[Tutor] Modules to work with curl.

Danny Yoo dyoo at hashcollision.org
Thu Jul 17 21:15:18 CEST 2014


On Thu, Jul 17, 2014 at 11:35 AM, Santosh Kumar <rhce.san at gmail.com> wrote:

> I am currently working on a project , which has lots of curl commands. I am
> using subprocess.Popen to run these curl commands. But somehow i see its bit
> slow.
> Is there a way/module by which i can improve the performance of the program.


If the use of curl really is responsible and worthwhile to optimize,
then you might consider using pycurl if you really need the full
features of curl.

    http://pycurl.sourceforge.net/

But can you say more what you're doing with curl?  More information
may let us give better advice.  The core lesson of
http://www.cs.bell-labs.com/cm/cs/pearls/cto.html is always in my
mind: we may not actually know the right question yet, so we must be
careful about our answers, lest we mislead.

I don't think we really understand the problem yet, so tell us more if you can.

I would also recommend profiling if you haven't done so already.
You've pointed out that something is slow, but unless you've actually
measured what's really responsible, anything could be contributing.
It may be, for example, that you're being limited by your network
throughput, in which case trying to make your program go faster will
not be effective.  You really must measure: otherwise, it's guesswork
and crossed fingers.

See:  https://docs.python.org/2/library/profile.html for documentation
on Python profiling.


More information about the Tutor mailing list