Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 months ago.
Why is HTTP so slow?
Hi,
Thanks for sharing this library, it's by far the most stable I've tried so far and your SmartLight project is an excellent example of how to use it.
The one thing that puzzles me is why RPC is so much slower with the new mbed EthernetInterface than it was with the old EthernetIf library. Adding trace has got me to HTTPConnection::receiveLine() which reads the characters from the TCP object one at a time looking for end-of-line. receiveLiine() takes about 0.3 seconds per header line with the "Accept" header (71 characters in my case) taking 0.7 seconds. For 7 header lines that's 3 seconds!
I'd be grateful for any insights or thoughts you have on this.
Thanks in advance
I noticed that the communication was a bit slow, but it was fast enough for what I needed so I didn't spend too much time investigating the problem. I think that I chose the EthernetInterface library based on the HTTP Server, and Henry Leinen's HTTP Server library worked the best out of the several that I tried. That was several months ago, so it might be worthwhile trying some of the other HTTP Servers to see if their code has matured.
posted by C Sonsino 03 Jul 2014@Richard Did you try to turn off the debugging? I turned off by adding "#undef DEBUG" in hl_debug.h from the library. For me it is now much faster!
posted by karel.vanroye@... 11 Nov 2014