Skip to content

optimized python memory usage by disabling unused modules#55

Open
niklasarnitz wants to merge 1 commit intoOpenCentauri:mainfrom
niklasarnitz:optimize-python-memory-size
Open

optimized python memory usage by disabling unused modules#55
niklasarnitz wants to merge 1 commit intoOpenCentauri:mainfrom
niklasarnitz:optimize-python-memory-size

Conversation

@niklasarnitz
Copy link
Copy Markdown

Proof of concept to reduce the memory footprint of python.
I can't test it on my printer at the moment since I'm on vacation now.
But it builds.

@jamesturton
Copy link
Copy Markdown
Collaborator

This looks exciting!
Will test it out later 😄

@jamesturton
Copy link
Copy Markdown
Collaborator

Well it doesn't seem to cause any regressions which is great!
I saw a 2~3% reduction in ram during idle when running this change, but I'm honestly not sure how much variation there is between boots so that might just be within the normal variation.

As I'm not a super python geek, is there a way that I can check that python is actually using the pre-compiled .pyc bitcode? I guess I could try removing all the .py files just to test, but you said that there was still some dependency on the .py file iirc?

@jamesturton
Copy link
Copy Markdown
Collaborator

Removing the unused python modules just saves us some disk space if we aren't importing them at runtime right? Or did I miss something?

@suchmememanyskill
Copy link
Copy Markdown
Contributor

So i tested #70 with -OO, this makes klippy crash during boot :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants