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

have the C++ compiler generate the tables. #556

Merged
merged 9 commits into from
Nov 16, 2023
Merged

Conversation

lemire
Copy link
Member

@lemire lemire commented Nov 7, 2023

Instead of having hard-coded tables, we can ask the C++ to generate them.

There is no obvious performance degradation (benchdata, LLVM 14).

cc @ShogunPanda

@lemire lemire requested a review from anonrig November 7, 2023 21:55
@ShogunPanda
Copy link

To be honest, since I also believe it won't affect performance, I would merge this.

Even if you did it for fun I actually think it improves readability of the code: rather than manually review the code it is easier to spot which elements are set to true and why.

WDYT?

@lemire
Copy link
Member Author

lemire commented Nov 12, 2023

I don’t disagree but we need to investigate the CI issues. At least one is unrelated to this PR, and I will examine it soon.

The performance should be identical, but we should check that it is before merging, as an abundance of caution.

@lemire
Copy link
Member Author

lemire commented Nov 13, 2023

@anonrig This could be merged.

Note that if you have an old compiler with partial support for C++17, this code might break it. We require genuine C++17 support.

@lemire lemire changed the title Demonstrating that if we prefer, we can have the C++ compiler generate the tables. have the C++ compiler generate the tables. Nov 13, 2023
@lemire
Copy link
Member Author

lemire commented Nov 13, 2023

@anonrig I don't know how to fix the linter errors. I ran clang-format on the code.

@lemire
Copy link
Member Author

lemire commented Nov 13, 2023

@anonrig I think I fixed the linter issue by reverting clang-format to version 14. Indeed, clang-format is version specific.

src/helpers.cpp Outdated Show resolved Hide resolved
src/helpers.cpp Outdated Show resolved Hide resolved
src/helpers.cpp Outdated Show resolved Hide resolved
src/unicode.cpp Outdated Show resolved Hide resolved
src/unicode.cpp Show resolved Hide resolved
@lemire
Copy link
Member Author

lemire commented Nov 14, 2023

@anonrig All reasonable comments.

@lemire
Copy link
Member Author

lemire commented Nov 15, 2023

@anonrig Code updated.

src/helpers.cpp Outdated Show resolved Hide resolved
@lemire lemire requested a review from anonrig November 15, 2023 18:01
@lemire
Copy link
Member Author

lemire commented Nov 15, 2023

@anonrig Might be good now.

@anonrig anonrig merged commit f1e0eed into main Nov 16, 2023
35 checks passed
@anonrig anonrig deleted the do_not_need_explicit_tables branch November 16, 2023 00:22
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

Successfully merging this pull request may close these issues.

3 participants