std.net.curl - get() is too slow

Brad Anderson eco at gnuk.net
Fri Dec 20 11:42:00 PST 2013


On Friday, 20 December 2013 at 18:23:30 UTC, Benji wrote:
> When I call get() function from std.net.curl,
> I notice it's extremely slow!
> Maybe 50 times slower than in Python..
>
> Is there any better/faster alternative?

Without doing any profiling I'd say this character concatenation 
while decoding is probably a large source of any slowness.

https://github.com/D-Programming-Language/phobos/blob/master/std/net/curl.d#L1908

Switching it to Appender or doing some sort of batch processing 
would probably help a lot.  Even just a .reserve() would probably 
do wonders.


More information about the Digitalmars-d-learn mailing list