Performance margins on urequests #10631
the-maldridge
started this conversation in
General
Replies: 2 comments 1 reply
-
urequests does a dns lookup every time it runs so if you're calling your server by name rather than ip address that could be where some of the delay is? Also https (port 443) takes longer than http (port 80) because of the encryption. |
Beta Was this translation helpful? Give feedback.
1 reply
-
If I'm in a tight control loop I usually dispense with urequests & use a function like this
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently building a prototype that fetches a packet of control information from a webserver in a very tight loop. The webserver runs on a regular amd64 server and is written in Go. The results from
hey
suggests that my P99 latency is well under one millisecond, which seems reasonable for the test endpoint that just serves the time.On the micropython side I am testing with an rpi pico w, and polling the
/time
endpoint of my server in a tight loop. I notice, however, that I only get about 2 requests per second and this seems very slow. Is this the expected performance that I should be able to get out of micropython? I suspect this code may need to be rewritten in C to achieve the performance margins I require, but I'd appreciate any input before I go that route.Beta Was this translation helpful? Give feedback.
All reactions