Addons using requests are very slow on Raspberry Pi

  • We discovered that addons using the **requests** library are very slow on Raspberry Pi.

    This appears to be related to the fact that importing the requests library takes up 4 seconds.


    You can find more information at:

    - Importing requests very slow (4 seconds) on Raspberry Pi · Issue #5080 · kennethreitz/requests · GitHub

    - Importing requests very slow on Raspberry Pi · Issue #25 · Freso/script.module.requests · GitHub

    - Addon is quite slow on Raspberry Pi · Issue #169 · pietje666/plugin.video.vrt.nu · GitHub


    Have other people noticed this ?


    Unfortunately the Kodi repositories only hosts up to 2 versions of a module, so it is hard to go back to find when this was introduced.

  • thanks for figuring out what's going on

    We discovered that addons using the **requests** library are very slow on Raspberry Pi.

    This appears to be related to the fact that importing the requests library takes up 4 seconds.

    my hand rolled surround sound controller addon got smashed by this.


    after some debugging i came to the same conclusion a few days ago.

    rpi3 on LE 8* was snappy (~2s) on 9.0.1 it takes ~7sec.


    - vol up/down keys are bound to "runScript(myVol, direction)"

    - it does one POST, direction ... the plain/text reply [0-100] is displayed in a slider.nob

    - all logic is handled serverSide in nodeRed


    i need the wife to be happy now :P

    so i'm temporarily using v = subprocess.check_output([ "curl", "-X", "POST", "-d", "up" ... ])

  • There has been some work implemented in script.module.urllib3 version 1.25.3 that significantly improves upon this slowdown issue. See PR #55 - Remove excess IRI matcher compilation.


    If you have Kodi automatic updates enabled then this component has probably already updated to the latest version.


    If you have Kodi automatic updates disabled then you can manually install script.module.urllib3 version 1.25.3 with the following steps which assume the Confluence skin - should be similar with other skins:


    1. Navigate to System -> Settings -> Add-ons -> Available updates.


    2. Choose urllib3 and follow the prompts to Update to version 1.25.3.


    Thanks goes to the persons who identified this issue and those who worked to resolve the issue. :)


    EDIT: For more details see the ongoing discussion starting here.

    Edited once, last by gedakc: Add link to ongoing performance discussion. ().