-->
Page 3 of 4

Re: Latency with WifiClient.print()

PostPosted: Fri Apr 24, 2015 12:46 pm
by reaper7
@Chris--A - many TNX!!!
1000% better :)
I have small script to rcv jpg image from vc0706 vga camera (connected via uart)
and publish it on esp8266 webpage...
before changes:
320pxX240px (~12kB) -> 32sec to open on webpage,
now, with Your sugestion:
the same image are show on webpage in 3-4sec! incredible :)

Re: Latency with WifiClient.print()

PostPosted: Fri Apr 24, 2015 1:05 pm
by martinayotte
draco wrote:I have posted some performance benchmark type numbers in another thread here.

@draco, maybe it is a good idea to redo the benchmark with the new fix, because it seems really that Chris put its finger on the beast ! ;)

Re: Latency with WifiClient.print()

PostPosted: Fri Apr 24, 2015 10:34 pm
by Chris--A
Great to hear.

I'll add a pull request for the changes.

EDIT: https://github.com/esp8266/Arduino/pull/111/files

Re: Latency with WifiClient.print()

PostPosted: Sat Apr 25, 2015 9:19 pm
by igrr
The reason latency is improved with this change is actually quite simple. The call to delay(5000) is used to wait for the packet delivery confirmation, but no more than 5 seconds. So the latency is not really associated with the delay() call, it is due to the fact that TCP ACK does not come immediately.
Perhaps calling tcp_output() improves latency somewhat, but you really need to wait for ACK afterwards, otherwise just use UDP.