Repository navigation
Conversation
…dency script.module.certifi becomes a direct dependency: requests used to bring it along, and http_client uses its CA bundle for certificate checks.
A 204 or other empty response can still carry a Content-Encoding header, and zlib fails on empty input.
requests sent its own User-Agent, http.client sends none, which some reverse proxies and firewalls reject.
|
I genuinely have no interest in this, sorry. We explicitly moved to requests over the built in httplib for ease of maintainability way back in #7. A small speed increase on what's effectively 6 year old potato hardware isn't worth undoing that, imo. Current master loads my home in 3.52 seconds. This PR loads it in 3.47 seconds. That's such a small difference it might as well not exist. Might be a better use of time to make more varied custom widgets that have less in scope so they load faster (ie: it's significantly faster to load |
|
Thank you for the thorough response, I understand. Indeed, with the context of the previous PR that introduced
Fair point 😄 nevertheless, it does the job just fine. If it wasn't for that slow widget loading. I already made sure my widgets are limited to request only 20 items, that did improve things a bit as well. But you're right, eventually a more powerful device will have to come in. |
This is the most significant improvement found during my work to improve load times for JellyCon widgets.
This PR drops the
requestsdependency and uses a small lightweighthttp_clientbased on the Python standard library instead.The new
http_clientmodule covers what the API client needs on top ofhttp.client: timeouts, certificate checking (with certifi when available), redirects and gzip/deflate bodies. Everything should work the exact same way as before, the only difference is that now we send a custom user-agent header (JellyCon/<version>) instead of the default one thatrequestssends (python-requests/x).On my ODroid N2+ I measured ~0.33 s to import
requestswhich affects every plugin call. When loading 4 widgets on a home screen, the total load time improvement was a very significant ~6.1 s.The changes here were done with AI assistance (Claude Opus 5.5). I reviewed everything and verified changes manually.
I am aware this is not a small change. If desired, I can provide detailed information about my testing (logs with timestamps, the specific widgets I used, my JellyCon settings etc.). Let me know and I'll be happy to help where I can, would love to see this merged so others can benefit and I don't have to maintain my own fork.