-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve documentation of nearest_po2()
#72091
Conversation
97a83f3
to
3847d87
Compare
It'd be great if you could also update the Also, we should add some unit tests for this method. |
@raulsntos C# already uses this PR's optimization, but keeps the edge cases. I could add I would like some sort of consensus on this before proceeding with adding test cases. |
Yeah, that's what I meant, if we're changing the behavior for GDScript we should also change it for C#.
Makes total sense, I just wanted to note that this method doesn't currently have unit tests. |
Also I don't really know where to add such tests. We have tests on the engine funcs, but I can't find anything for the GlobalScope. Few of the math functions in |
3847d87
to
3ac5603
Compare
3ac5603
to
7efef0f
Compare
7efef0f
to
490ae01
Compare
Stripped this PR a bit and its compat-breaking aspects. Now it's just a performance boost for GDScript and documentation tweak. Should be safe, but it's not that important. Can wait for after 4.0 p.s. Should change label from bug to performance, given this. |
nearest_po2()
nearest_po2()
Weirdly enough, I don't measure the performance boost I previously did. I have no idea why, previously I measured a 30% boost when the function had extra steps. Maybe I benchmarked poorly. Or maybe something else happened that optimized it. Anyway, I'm yet again reshaping this. Now it's just a documentation PR lol |
02b80ab
to
bdbc619
Compare
nearest_po2()
nearest_po2()
pokey pokey! |
Thanks! |
Note: This PR used to change behavior too, but now it's just a performance PRNote: This PR is now just a documentation tweak.
Addresses an extra corner case for the method and words the method description a little clearer.