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

Optimize performance of uniplot (v2) #42

Merged
merged 16 commits into from
Mar 8, 2025
Merged

Conversation

olavolav
Copy link
Owner

v2 of #40

@olavolav olavolav changed the title Optimize peformance of uniplot (v2) Optimize performance of uniplot (v2) Feb 23, 2025
@olavolav
Copy link
Owner Author

2 remaining failing tests:

  1. Braille character support
  2. tests/acceptance/test_user_behavior.py::test_massively_multi_series_plotting fails with IndexError: index 548 is out of bounds for axis 0 with size 6 in line 151, where it says pixels[non_zero_mask] = decoder_c[index].

PabloRuizCuevas and others added 12 commits February 23, 2025 17:49
using cache for speeding up execution
I leverage sparsity by setting empty characters at initialization instead of one by one.

then I convolute in 4x4 squares the matrix using a 4 dimensional sumation trick for checking if is empty there (normally we could use scipy for this)

Now i know where is not empty i iterate the non-empy places only, which is fast. like 20x faster.
@olavolav olavolav force-pushed the performance_improvements branch from 7d432eb to c60f726 Compare February 23, 2025 16:50
@PabloRuizCuevas
Copy link
Contributor

PabloRuizCuevas commented Feb 25, 2025

@olavolav could you give write permissions to uniplot pls? otherwise I need to push to my branch again, I can´t really edit anything here.

Or just change this, whatever it takes less time for you.

image

@PabloRuizCuevas
Copy link
Contributor

actually you only need to add %len(colors) in line 144 , remove the duplication of pixels= in both 108 116 and fix the swapped height width in the line 86, no need to put the zip stuff

@olavolav
Copy link
Owner Author

olavolav commented Mar 8, 2025

Made minor modifications for readability, otherwise looks good to go 🚀

@olavolav olavolav merged commit 0a94c67 into master Mar 8, 2025
4 checks passed
@olavolav olavolav deleted the performance_improvements branch March 8, 2025 08:01
@olavolav
Copy link
Owner Author

olavolav commented Mar 8, 2025

This is now live as v0.17.0. 🚀

Thank you for the contribution!

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