1.14 or 1.13 - import libs is slower than 1.12 ? (test)

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

1.14 or 1.13 - import libs is slower than 1.12 ? (test)

Post by prem111 » Wed Oct 28, 2020 6:59 pm

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
Last edited by prem111 on Fri Feb 19, 2021 9:04 pm, edited 3 times in total.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: 1.13 - import libs is slower than 1.12 ?

Post by stijn » Wed Oct 28, 2020 7:11 pm

Which libraries, and how did you measure this exactly?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: 1.13 - import libs is slower than 1.12 ?

Post by jimmo » Wed Oct 28, 2020 11:51 pm

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.

prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: 1.13 - import libs is slower than 1.12 ?

Post by prem111 » Thu Oct 29, 2020 8:07 am

Board is esp32. But it is like that with every boot. The difference can be seen when importing e.g. uasyncio.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: 1.13 - import libs is slower than 1.12 ?

Post by jimmo » Thu Oct 29, 2020 10:51 am

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).

prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: 1.13 - import libs is slower than 1.12 ?

Post by prem111 » Fri Feb 19, 2021 6:48 pm

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


prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)

Post by prem111 » Sat Feb 20, 2021 1:18 pm

I noticed that the more files there are (even without imports) in the filesystem, the slower it works

Online
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)

Post by Roberthh » Sat Feb 20, 2021 4:22 pm

Especially LFS is slow

prem111
Posts: 127
Joined: Sun Feb 23, 2020 3:18 pm

Re: 1.14 or 1.13 - import libs is slower than 1.12 ? (test)

Post by prem111 » Sun Feb 21, 2021 11:03 am

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.

Post Reply