Page 1 of 1
1.14 or 1.13 - import libs is slower than 1.12 ? (test)
Posted: Wed Oct 28, 2020 6:59 pm
by prem111
Hi. I noticed that the library imports slower in version 1.13. What is it caused by? I am using the unstable version.
Code: Select all
v.1.12:
>>> time.ticks_ms();import uasyncio;time.ticks_ms()
2008736
2008754
sys.path.append('libs')
>>> time.ticks_ms();from system_devices import *;time.ticks_ms()
2068585
2069417
v.1.13
>>> time.ticks_ms();import uasyncio;time.ticks_ms()
21461
21649
>>> time.ticks_ms();from system_devices import *;time.ticks_ms()
49162
50984
Re: 1.13 - import libs is slower than 1.12 ?
Posted: Wed Oct 28, 2020 7:11 pm
by stijn
Which libraries, and how did you measure this exactly?
Re: 1.13 - import libs is slower than 1.12 ?
Posted: Wed Oct 28, 2020 11:51 pm
by jimmo
And which board/port are you using?
The ESP32 and ESP8266 ports are very sensitive to code location changes due to caching effects and architectural issues. I see quite dramatic speed differences from just re-arranging code that is otherwise functionally identical.
Re: 1.13 - import libs is slower than 1.12 ?
Posted: Thu Oct 29, 2020 8:07 am
by prem111
Board is esp32. But it is like that with every boot. The difference can be seen when importing e.g. uasyncio.
Re: 1.13 - import libs is slower than 1.12 ?
Posted: Thu Oct 29, 2020 10:51 am
by jimmo
How did you measure it? How much difference is there?
Note that in 1.13 vs 1.12 would be a different version of uasyncio too (v3 vs v2).
Re: 1.13 - import libs is slower than 1.12 ?
Posted: Fri Feb 19, 2021 6:48 pm
by prem111
in version 1.13 or 1.14 it is just as slower when importing the same libraries. nobody suggested that it was faster on 1.12?
Code: Select all
v.1.12:
>>> time.ticks_ms();import uasyncio;time.ticks_ms()
2008736
2008754
sys.path.append('libs')
>>> time.ticks_ms();from system_devices import *;time.ticks_ms()
2068585
2069417
v.1.13
>>> time.ticks_ms();import uasyncio;time.ticks_ms()
21461
21649
>>> time.ticks_ms();from system_devices import *;time.ticks_ms()
49162
50984
Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)
Posted: Sat Feb 20, 2021 1:18 pm
by prem111
I noticed that the more files there are (even without imports) in the filesystem, the slower it works
Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)
Posted: Sat Feb 20, 2021 4:22 pm
by Roberthh
Especially LFS is slow
Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)
Posted: Sun Feb 21, 2021 11:03 am
by prem111
Ok, there was a problem here, fat works much faster. I haven't noticed that as of 1.13, littlefs is created by default. Thank you for your answer.