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

Drastic bottleneck: array joining #13

Closed
florian-huber opened this issue Dec 2, 2022 · 2 comments · Fixed by #12
Closed

Drastic bottleneck: array joining #13

florian-huber opened this issue Dec 2, 2022 · 2 comments · Fixed by #12

Comments

@florian-huber
Copy link
Collaborator

The current implementation for merging arrays is FAR TOO SLOW.
Slicing and other operations seem fine, but adding data to a StackedSparseArray is painfully slow (even though the implementation was done with numba, but probably not the best way...)

@florian-huber
Copy link
Collaborator Author

I did a lot of profiling on this (see #11 for more details), including Numpy (multiple variants), Pandas, Polars, Numba (multiple variants). A new Numba try seems to improve this quite a bit --> #12

With a simple profiling script I got the following.

Current implementation:

Addition of first layer
 ----------------------------------------
Computation took 29.094916343688965 s.

Addition of new layer
 ----------------------------------------
Computation took 42.284873962402344 s.

Slicing 1
 ----------------------------------------
Computation took 0.010562658309936523 s.

Slicing 2
 ----------------------------------------
Computation took 0.01617717742919922 s.

Slicing 3
 ----------------------------------------
Computation took 0.01498723030090332 s.

New variant (#12):

Addition of first layer
 ----------------------------------------
Computation took 0.007983207702636719 s.

Addition of new layer
 ----------------------------------------
Computation took 0.7480928897857666 s.

Slicing 1
 ----------------------------------------
Computation took 0.008943796157836914 s.

Slicing 2
 ----------------------------------------
Computation took 0.013475418090820312 s.

Slicing 3
 ----------------------------------------
Computation took 0.014035463333129883 s.

@florian-huber
Copy link
Collaborator Author

I consider this fixed with #12

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 a pull request may close this issue.

1 participant