-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing requests very slow (4 seconds) on Raspberry Pi #5080
Comments
As I said in Freso/script.module.requests#25 (comment), this is almost certainly directly due to urllib3/urllib3#1590 (@dagwieers even mentions |
Due to urllib3 v1.25.x’s inclusion of `rfc3986` it’s compiling a bunch of regexes every time `urllib3` is imported… which it is every time `requests` is imported, which is imported by a ton of Kodi add‐ons. The best solution here would be either for `urllib3` (or `rfc3986`) to be smarter about the regex compiling, or for Kodi to not need to reimport Python libraries on every view change… However, neither of those are here‐and‐now fixes and upstream `urllib3` have released a version of 1.24.x which includes the security fix that was previously only available in the 1.25.x releases, so downgrading to 1.24.3 until this is handled better either by urllib3, its consumers, or Kodi itself. Fixes #3 and Freso/script.module.requests#25 See also issue reported to upstream: urllib3/urllib3#1590 And issue reported to upstream `requests`: https://github.com/kennethreitz/requests/issues/5080 Based on urllib3-1.24.3.tar.gz from PyPI: https://pypi.org/project/urllib3/1.24.3/#files
This should have been resolved through the outcomes of urllib3/urllib3#1590. |
We found that importing requests on Raspberry Pi is very slow.
It takes 4 seconds.
Given that Kodi calls python addons for every menu change, navigating within addons is dreadfully slow (at least 4 seconds in between clicks).
Profiling and system call tracing output at: Freso/script.module.requests#25
Looking for a way to disable specific packages and keep requests more simple in nature.
Expected Result
Sub-second behaviour as on Windows and Android.
Actual Result
It appears that compiling the rfc3986 regular expressions is taking up most of the meat here.
Reproduction Steps
System Information
This also takes 5 seconds ;-)
The text was updated successfully, but these errors were encountered: