#So I did some more testing I wrote a

1 messages ยท Page 1 of 1 (latest)

stiff rock
#

interesting -- i would expect some hit on these microprocessors for that kind of loading, but had not ever seen any actual data

i also have not seen any guarantee of "instant on" either ๐Ÿ˜€

rocky rose
#

Haha, no, of course not. And, as I'm doing more testing, it turns out that my time tracking of import times slow down the startup massively!

The relative differences between file imports and a giant mega-class still remains, but the startup time is at around 1.3 seconds to showing a splash screen, and that is totally fine.

#

I really could let this go... But... I like messing about with stuff like this to understand it.

stiff rock
#

yep -- i got a few rabbit holes going myself

rocky rose
#

I'm now looking at ways to delay imports until they are actually needed. gui.py has code for showing a minimal splash screen, and then a lot more imports for showing fancy stuff involving bitmap fonts and stuff. So, I'm now playing with moving those imports into the functions that actually need them. Saved myself 300 ms! ๐Ÿ™‚

stiff rock
#

๐Ÿฅณ

tepid rain
#

if you have a specific methods that is the only one that needs a specific import, you can inline the import, but you would take that hit there (and possibly every time)

stiff rock
#

i don't know how that particular mechanism works -- i'm much more a kotlin/java guy, i only python when i have to ๐Ÿ˜

rocky rose
celest breach
#

If you're open to sharing your "compile" code that combines them and an example of how you set up the measurements I'd be interested in playing with those capabilities

rocky rose
celest breach
#

I do think that's true about imports only working the 1st time as well. I don't know the mechanism specifically. But if you have code in the root of the file it only executes the first time you import which makes it slightly harder to iterate over a file and test it in REPL.

#

Gist, github. Or even just a pastebin, or whatever is easiest for you tbh.

#

I think it might be interesting to see the timing effects on different projects.

rocky rose
#

OK. I'll look at in within the hour. Just need to do some domestic chores (including having my first coffee of the day)

celest breach
#

absolutely, whenever you get to it is totally cool with me. Thank you for going down the rabbit hole a bit and sharing the numbers as well!

tepid rain
#

I would love to hear what you two find. I also have a project with quite a few imports. Anything leared would be awesome

rocky rose
#

@celest breach , here you go

#

Let me know if the readme.txt isn't clear enough for how to use.