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

merge isAsciiWhitespace implementations #2803

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 25, 2024

Merges 2 implementations and introduces 2 new cc_library targets on bazel.

@anonrig anonrig requested review from a team as code owners September 25, 2024 15:50
@anonrig anonrig requested review from jasnell and mar-cf September 25, 2024 15:50
@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch 3 times, most recently from f5810f1 to e05c0ac Compare September 25, 2024 17:28
@anonrig anonrig requested a review from fhanau September 25, 2024 17:34
@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch from e05c0ac to c4b2d5e Compare September 25, 2024 19:49
@anonrig anonrig requested a review from mikea September 25, 2024 19:49
@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch 5 times, most recently from b2ed219 to 30f7bb5 Compare September 25, 2024 20:04
src/workerd/api/BUILD.bazel Outdated Show resolved Hide resolved
@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch 2 times, most recently from 270c5f5 to f943917 Compare September 25, 2024 20:31
@anonrig anonrig requested a review from fhanau September 25, 2024 20:34
src/workerd/io/io-timers.h Outdated Show resolved Hide resolved
src/workerd/io/BUILD.bazel Outdated Show resolved Hide resolved
src/workerd/api/BUILD.bazel Outdated Show resolved Hide resolved
return result;
}();

constexpr bool isAsciiWhitespace(uint8_t c) noexcept {
Copy link
Collaborator

@fhanau fhanau Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually, this could affect performance – isAsciiWhitespace() does a single table lookup so having it defined in a different source file will make using it much slower based on needing a function call now. The compiler might just be able to inline it properly if LTO is enabled (such as with the downstream release build), so this is non-blocking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the implementation to encoding.h and made it constexpr again. Since it is an extremely small fixed array, I don't think it would have any negative impact, but let me know if you disagree. I can change it back without any hassle.

@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch from f943917 to a5eae95 Compare September 25, 2024 23:39
@anonrig anonrig requested review from jasnell and fhanau September 25, 2024 23:39
@anonrig anonrig force-pushed the yagiz/merge-is-ascii-whitespace branch from a5eae95 to 413d5a5 Compare September 25, 2024 23:40
@anonrig
Copy link
Member Author

anonrig commented Sep 25, 2024

...just in case...

@anonrig anonrig merged commit bde0b2c into main Sep 26, 2024
14 of 15 checks passed
@anonrig anonrig deleted the yagiz/merge-is-ascii-whitespace branch September 26, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants