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

crop_cube() very expensive #8

Open
georgedorn opened this issue Jul 11, 2023 · 2 comments
Open

crop_cube() very expensive #8

georgedorn opened this issue Jul 11, 2023 · 2 comments

Comments

@georgedorn
Copy link

I've done some profiling runs to see where the most time is spent. In the main (mikepound) branch, 8% of the runtime for n=9 is spent within the crop_cube() function. In my merged branch, containing both my PR and @bertie2's PR, it's 18% of runtime, due to the biggest offender (rle()) being called less and executing faster.

It's the next logical step to attempt a speedup. I think the best path here is that rather than cropping naively, track where the new cube was added and crop where we know we only added 0s. This saves us from iterating over every cube in a side before deciding to trim it. This won't be easy and expand_cube() probably won't end up with as clean an implementation.

@bertie2
Copy link

bertie2 commented Jul 12, 2023

significantly improved by @ana-096 at #11

@mikepound
Copy link
Owner

@georgedorn As per a discussion I was having with @bertie2, I've created a new repo which will host the community changes to this code, to keep this version in line with the original video. Are you interested in being a maintainer on this other repo? I expect no commitment :) But this could be a good way of letting people contribute code without everything going through me, which will likely be an extremely slow process!

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

No branches or pull requests

3 participants