arduino-libraries / ArduinoHttpClient

Arduino HTTP Client library
282 stars 170 forks source link

Reduce timeout from 1000ms to 100ms #125

Closed carbotaniuman closed 6 months ago

carbotaniuman commented 2 years ago

Using this with the Arduino WiFiClient makes simple requests really slow. Reduce the timeout in order to make it faster.

github-actions[bot] commented 2 years ago

Memory usage change @ 527967d010b0b2e290ca051e6ce9e6c821f00c58

Board flash % RAM for global variables %
arduino:samd:mkr1000 :green_heart: -8 - -8 -0.0 - -0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/BasicAuthGet
flash|%|examples/BasicAuthGet
RAM for global variables|%|examples/CustomHeader
flash|%|examples/CustomHeader
RAM for global variables|%|examples/DweetGet
flash|%|examples/DweetGet
RAM for global variables|%|examples/DweetPost
flash|%|examples/DweetPost
RAM for global variables|%|examples/HueBlink
flash|%|examples/HueBlink
RAM for global variables|%|examples/PostWithHeaders
flash|%|examples/PostWithHeaders
RAM for global variables|%|examples/SimpleDelete
flash|%|examples/SimpleDelete
RAM for global variables|%|examples/SimpleGet
flash|%|examples/SimpleGet
RAM for global variables|%|examples/SimpleHttpExample
flash|%|examples/SimpleHttpExample
RAM for global variables|%|examples/SimplePost
flash|%|examples/SimplePost
RAM for global variables|%|examples/SimplePut
flash|%|examples/SimplePut
RAM for global variables|%|examples/SimpleWebSocket
flash|%|examples/SimpleWebSocket
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- arduino:samd:mkr1000|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0|-8|-0.0|0|0.0
Click for full report CSV ``` Board,examples/BasicAuthGet
flash,%,examples/BasicAuthGet
RAM for global variables,%,examples/CustomHeader
flash,%,examples/CustomHeader
RAM for global variables,%,examples/DweetGet
flash,%,examples/DweetGet
RAM for global variables,%,examples/DweetPost
flash,%,examples/DweetPost
RAM for global variables,%,examples/HueBlink
flash,%,examples/HueBlink
RAM for global variables,%,examples/PostWithHeaders
flash,%,examples/PostWithHeaders
RAM for global variables,%,examples/SimpleDelete
flash,%,examples/SimpleDelete
RAM for global variables,%,examples/SimpleGet
flash,%,examples/SimpleGet
RAM for global variables,%,examples/SimpleHttpExample
flash,%,examples/SimpleHttpExample
RAM for global variables,%,examples/SimplePost
flash,%,examples/SimplePost
RAM for global variables,%,examples/SimplePut
flash,%,examples/SimplePut
RAM for global variables,%,examples/SimpleWebSocket
flash,%,examples/SimpleWebSocket
RAM for global variables,% arduino:samd:mkr1000,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0,-8,-0.0,0,0.0 ```
andersruneson commented 1 year ago

Why not even lower delay, such as 5 or 10 ms? The code just loops and waits for this delay.

andreagilardoni commented 6 months ago

@carbotaniuman thanks for your contribution!