-
Notifications
You must be signed in to change notification settings - Fork 432
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 isEmptyDeep #1230
optimize isEmptyDeep #1230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow that is great! Thank you!
Please add a few more tests like requested and then I think we can merge this
@Falke-Design I've added the requested tests and made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really a nice improvement! Thank you very much!
@codeofsumit will make merge before the next release
@Falke-Design Thank you for the review! Do you know when approximately next release is gonna happen? Is it weeks/months away? |
Maybe with the end of oktober. I need first to fix most of the bugs but currently I have not much time |
@Falke-Design I simplified the function a bit, removed the inner function |
I'm thinking about, if we should rename the function to |
@Falke-Design I agree the function reads a bit more straightforward now. And the name is shorter. Good suggestion 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing !!
TL;DR
isEmptyDeep
is now 300 times fasterFunction
isEmptyDeep
suffered from 2 problems:And since it's used in the snapping code, whenever you have many or just big geometries, the geometry editing is janky.
In this PR I optimized the
isEmptyDeep
function and added the tests for it.Video explanation:
https://www.loom.com/share/e70379b76e5141d984e773b70dd47921
Benchmark:
https://jsbench.me/h8l8dv6d7h/2