4 ms·
I had to search on hn.aloglia because this ridiculously bad science got rightfully killed. Did the OP even test with ruby/python/wget/curl ? Could be a DNS iss
by sitkack 13y ago
I had to search on hn.aloglia because this ridiculously bad science got rightfully killed.
Did the OP even test with ruby/python/wget/curl ? Could be a DNS issue and nothing to do with libcurl.
Why spend all that time and not run `gprof` ?!
- Restful 13y agoLooks like you're confusing things. While the article wasn't well done testing with your suggestions adds nothing more than unrelated , in the case of wget especially, background noise.
- sitkack 13y agoIt does in terms of narrowing down why libcurl could be slow. Are you presupposing it is slow for some reason? Nearly all http libraries should be running at wire speed which is << native | interpreted. Showing curl and wget from the command would have been highly beneficial. Would you not have tested that before writing an HTTP client in C?
- Restful 13y agoI see your point here for some baseline but I'm opposed to the comment about adding implementation of every library under the sun.
- sitkack 13y agoI said nothing about an impl, I mean wget -vv http://localhost:8080/bigbin.bin --header="Range:bytes=1000-20000" -O test.out curl -vvv http://localhost:8080/bigbin.bin --header "Range: bytes=1000-200000" -o test.out Both of these got 350MB/s + for impl, it isn't terribly difficult In [2]: from requests import Request, Session In [3]: s = Session() In [8]: req = Request('GET', 'http://localhost:8080/bigbin.bin', headers = { 'Range' : 'bytes=1000-2000000' } ) In [9]: prepped = s.prepare_request(req) In [10]: %timeit resp = s.send(prepped) 1 loops, best of 3: 238 ms per loop All of these are faster than what he outlined. So there is some _other_ issue going on. His hand rolled http request is faster but not for the reason he thinks. Crack out some wireshark, not some code.