-
Notifications
You must be signed in to change notification settings - Fork 25
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
gfx_sort1 takes way too long on big matrices #54
Comments
Actually, it's not consistent there either, now it's been running for ~5 minutes. |
That is to be expected. The time for completion is highly dependent on display size. This is an inherent property of sorting algorithms. Complexity of the algorithmBubblesort has a runtime of O(n^2) (see https://en.wikipedia.org/wiki/Bubble_sort#Performance). For the simple variant where only diagonals are sorted the complexity on an AxB LED Matrix should be O(max(A,B)^2). The Complex variant might have longer path lengths between the starting position of a pixel and the final position, but the complexity class should still be similar. The expected number of frames should should be different as O(AB) locations are considered per step. Speedup Ideas
ConclusionGetting on or near a target number of frames isn't feasible right now as the runtime depends on sorting mode and I'm too lazy to measure for future predictions. You might manually adjust the framerate or deactivate the module. |
It's not a bug. It's a feature/inherent property of the algorithm. |
Sorry that I marked it as a bug, not an enhancement, my bad. Yeah, I get it, I was thinking something like a frame limit, so it doesn't run for ages on big matrices and gives other modules a chance to run as well. |
Another speedup idea: Scale a "sorting pixel" to multiple LEDs on higher resolutions; or, in other words, lower the resolution of the sorting matrix. E.g. 2x2 LEDs per "sorting pixel" on a 64x64 LED matrix, 3x3 on 96x96, 4x4 on 128x128 etc... |
It should probably try to finish in a fixed time - or at least similar times - when running on a different matrix size.
On my X200's display, it takes a long time, probably over a minute.
The text was updated successfully, but these errors were encountered: