Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animated Gif Player Performance improvements #61

Closed
makermelissa opened this issue Jan 9, 2020 · 6 comments
Closed

Animated Gif Player Performance improvements #61

makermelissa opened this issue Jan 9, 2020 · 6 comments
Assignees

Comments

@makermelissa
Copy link
Contributor

I mostly want to list ideas here for performance improvement ideas. The first idea I had is taking the image loading time into account for the delay. At the moment it loads the images, then does a delay. This change should have a significant impact.

@makermelissa makermelissa self-assigned this Jan 9, 2020
@ladyada
Copy link
Member

ladyada commented Jan 10, 2020

good idea, time.monotonic() ftw :)

@makermelissa
Copy link
Contributor Author

time.monotonic is now implemented. I'll keep this open for a while longer to continue listing ideas.

@philippkeller
Copy link
Contributor

philippkeller commented Jan 12, 2020

A side note on speed improvements: I first tried this repo without numpy installed and a call to image() lasted around 0.58s, I nearly gave up, until I saw the if/else around numpy in the image function. After installing numpy it only took 0.075s so this is almost 8x as fast as without numpy.

IMO you could/should output a warning when numpy is not available as I was almost giving up this repo because of speed issues.

@ladyada
Copy link
Member

ladyada commented Jan 12, 2020

@philippkeller we should import numpy in the main script to 'force' it to install, wanna submit that as a PR?

@makermelissa
Copy link
Contributor Author

I also added a section to the guide the other day suggesting NumPy be installed installed in the setup, but I like the suggestion of just adding an unused import.

@makermelissa
Copy link
Contributor Author

I think I'm going to close this. I was able to run this at a good speed on the Pi 4. The latest SPI addition in PureIO really helped and the code is pretty optimized at this point.

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

No branches or pull requests

4 participants