Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the network interface can't make any progress, it's probably a good idea to yeild the task so that the wifi task may run and proceed with actually sending/receiving data.
This seems to greatly improve response times, especially with low tick_rate_hz values. At 100Hz, ping time goes down from 25ms to <2ms. A simple http server test saw a response time reduction from 45ms to 6ms. At 1000Hz tick rate the gains are diminishing but there are some small gains. I ran my tests on esp32s3.
This might also increase throughput. I have not tested that. It also may have some unforseen adverse effects.
Ideally, we would have a more fine grained return value from interface.poll() than a bool so we have a better idea if yeilding is appropriate or not.
Perhaps with many sockets, yeilding like this is not a good idea.