www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.net.curl - get() is too slow

reply "Benji" <romanbeno273 gmail.com> writes:
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?
Dec 20 2013
next sibling parent "Brad Anderson" <eco gnuk.net> writes:
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.
Dec 20 2013
prev sibling parent "David Nadlinger" <code klickverbot.at> writes:
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?
How do you benchmark the functions? David
Dec 20 2013