Skip to content

[WTF] Refactor normalizedFloat and Add Test Cases #46942

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gumichocopengin8
Copy link
Member

@Gumichocopengin8 Gumichocopengin8 commented Jun 19, 2025

@Gumichocopengin8 Gumichocopengin8 self-assigned this Jun 19, 2025
@Gumichocopengin8 Gumichocopengin8 added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Jun 19, 2025
@Gumichocopengin8 Gumichocopengin8 marked this pull request as draft June 19, 2025 05:27
@Gumichocopengin8 Gumichocopengin8 force-pushed the eng/WTF-Refactor-normalizedFloat-and-Add-Test-Cases branch from aac1517 to 4c612e8 Compare June 19, 2025 05:34
@Gumichocopengin8 Gumichocopengin8 force-pushed the eng/WTF-Refactor-normalizedFloat-and-Add-Test-Cases branch from 4c612e8 to b58881d Compare June 19, 2025 06:01
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 19, 2025
https://bugs.webkit.org/show_bug.cgi?id=294707

Reviewed by NOBODY (OOPS!).

This patch refactors `normalizedFloat` and added test cases.

* Source/WTF/wtf/MathExtras.h:
(normalizedFloat):
* Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp:
(TestWebKitAPI::TEST(WTF, normalizedFloat)):
@Gumichocopengin8 Gumichocopengin8 removed the merging-blocked Applied to prevent a change from being merged label Jun 19, 2025
@Gumichocopengin8 Gumichocopengin8 force-pushed the eng/WTF-Refactor-normalizedFloat-and-Add-Test-Cases branch from b58881d to e888ea4 Compare June 19, 2025 11:02
@Gumichocopengin8 Gumichocopengin8 marked this pull request as ready for review June 19, 2025 12:59
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 19, 2025
@Ahmad-S792 Ahmad-S792 removed the merging-blocked Applied to prevent a change from being merged label Jun 24, 2025
@darinadler
Copy link
Member

Why refactor?

Is this smaller or faster than the old code?

@Gumichocopengin8
Copy link
Member Author

I think it's slightly faster because of less branches and less comparison.

@darinadler
Copy link
Member

I think it's slightly faster because of less branches and less comparison.

An interesting guess. Or maybe it’s slightly slower because of library function call overhead that might not be optimized away. I wonder which guess is correct.

@Gumichocopengin8
Copy link
Member Author

Hmm interesting.
What do you think is the best way to bench WTF functions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants