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

codegen: Remove last use-cases of Variant::has #1042

Merged
merged 1 commit into from
Aug 7, 2022

Conversation

Hendiadyoin1
Copy link
Contributor

We always know the internal typeid, so we can do this lookup our selves
and put less strain on the c++-compiler

@ilyapopov
Copy link
Contributor

This PR cuts 0.25s (2%):

hyperfine -r 5 "cd jakt/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp" "cd jakt-pr1042/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp"
Benchmark 1: cd jakt/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp
  Time (mean ± σ):     14.880 s ±  0.154 s    [User: 14.275 s, System: 0.585 s]
  Range (min … max):   14.736 s … 15.123 s    5 runs
 
Benchmark 2: cd jakt-pr1042/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp
  Time (mean ± σ):     14.634 s ±  0.048 s    [User: 14.174 s, System: 0.446 s]
  Range (min … max):   14.588 s … 14.705 s    5 runs
 
Summary
  'cd jakt-pr1042/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp' ran
    1.02 ± 0.01 times faster than 'cd jakt/build/ && clang++ -std=c++20 -I ../runtime/ -Wno-parentheses-equality -Wno-trigraphs -Wno-user-defined-literals jakt.cpp'

We always know the internal typeid, so we can do this lookup our selves
and put less strain on the c++-compiler
@Hendiadyoin1 Hendiadyoin1 marked this pull request as ready for review August 6, 2022 16:15
@sophiajt sophiajt merged commit f65075b into SerenityOS:main Aug 7, 2022
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.

None yet

3 participants