4 ms·
Given the final paragraph: > I still haven't answered a very important question. Why is libcUrl so much slower? I'd assume it's likely a result of misuse of l
by pipeep 12y ago
Given the final paragraph:
> I still haven't answered a very important question. Why is libcUrl so much slower?
I'd assume it's likely a result of misuse of libcUrl, or cUrl properly implementing some part of the spec that this hand-rolled implementation ignores.
On top of this, the author's C code isn't very well written. There's use of `sprintf` without arithmetic bounds checks (really he should use `snprintf`), unnecessary construction of a one-character array (that's what a dereference is for), inconsistent whitespace, `malloc` when a stack allocation would make more sense, use of `unsigned char` instead of `char` for strings, etc.
From what I can tell, the libcUrl guys are serious about performance, and I have trouble believing such a wild allegation without any further analysis.
- konceptz 12y ago>I'd assume it's likely a result of misuse of libcUrl, or cUrl properly implementing some part of the spec that this hand-rolled implementation ignores. Author again. I have my code in the post, it would be helpful for me to see what mistakes I've made in libcUrl utilization.
- pipeep 12y agoI'm not familiar with libcUrl, so I can't say what you missed, but I am suspicious. Do however look at my complaints about your code. I understand that writing good safe C code is hard (I've written plenty of bad C code myself), but that's one reason why you should use cUrl. Any code you write yourself is another liability.
- konceptz 12y agoI will certainly apply your suggestions to the code. Thanks