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

Use Numpy for all revisions #641

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

hchargois
Copy link
Contributor

Extend the use of numpy for serializing the image data of revisions B, C and D. Cf. #319

I've added tests to make sure the new serialization results in exactly the same calls to the serial interface as before. The tests can be run like this: python -m unittest from the root directory.

The tests can also be used as simple benchmarks (in that case the assertions are not checked) like this:

BENCHMARK=1 python -m unittest

On my machine, the benchmark results are as follows (before -> after)

  • Rev B: 0.56 s -> 0.009 s (~ 60x speedup)
  • Rev C: 1.45 s -> 0.036 s (~ 40x speedup)
  • Rev D: 0.36 s -> 0.015 s (~ 20x speedup)

This PR is based off of #622 so ideally that one should be merged before this one.

@hchargois
Copy link
Contributor Author

Rebased on top of main now that #622 is merged

@mathoudebine
Copy link
Owner

Thank you @hchargois much easier to read!
I will take some time to test it with the different displays before merging it

@mathoudebine
Copy link
Owner

@hchargois I successfully tested your PR against the 3 display revisions, everything works fine!
It actually helped me find an issue with the rev. B displays failing to display bitmaps properly when frames are sent too fast 😄 I'm merging your PR and will add a fix for the rev. B afterwards
Thanks again for your work!

@mathoudebine mathoudebine merged commit b08249e into mathoudebine:main Feb 12, 2025
39 of 41 checks passed
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.

2 participants