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
Shortcut to avoid fmod #66909
Merged
Merged
Shortcut to avoid fmod #66909
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
💚 CLA has been signed |
gf2121
force-pushed
the
shortcut_to_avoid_fmod
branch
from
January 3, 2021 04:21
658494b
to
9a32cd1
Compare
gf2121
force-pushed
the
shortcut_to_avoid_fmod
branch
from
January 3, 2021 04:23
9a32cd1
to
e26c9bb
Compare
gf2121
force-pushed
the
shortcut_to_avoid_fmod
branch
from
January 3, 2021 04:37
5a2bd1f
to
7c2aa45
Compare
matriv
added
the
:Search/Mapping
Index mappings, including merging and defining field types
label
Jan 4, 2021
Pinging @elastic/es-search (Team:Search) |
gf2121
force-pushed
the
shortcut_to_avoid_fmod
branch
from
January 19, 2021 13:39
cb332a4
to
7c2aa45
Compare
@matriv Hi, sorry to disturb. Could you please help take a look at this small enhancement when you are free? Thanks! |
@elasticmachine test this please |
gf2121
force-pushed
the
shortcut_to_avoid_fmod
branch
from
January 20, 2021 09:50
7c2aa45
to
e68e5eb
Compare
@elasticmachine test this please |
@matriv Hi, checks have passed :) |
I can see @gf2121 :) Thanks a lot for your contribution. |
matriv
added a commit
that referenced
this pull request
Jan 20, 2021
…67752) Benchmarking terms query (10000+ terms) on long type, shows that the code part costing most CPU is when trying to judge whether terms have a decimal part because a double mod is executed for each number, regardless of if it has a decimal part. Adding a check before the mod take place to exclude non-decimal numbers. (cherry picked from commit c32f8b1) Co-authored-by: gf2121 <52390227+gf2121@users.noreply.github.com>
alyokaz
pushed a commit
to alyokaz/elasticsearch
that referenced
this pull request
Mar 10, 2021
…6909) Benchmarking terms query (10000+ terms) on long type, shows that the code part costing most CPU is when trying to judge whether terms have a decimal part because a double mod is executed for each number, regardless of if it has a decimal part. Adding a check before the mod take place to exclude non-decimal numbers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>enhancement
:Search/Mapping
Index mappings, including merging and defining field types
Team:Search
Meta label for search team
v7.12.0
v8.0.0-alpha1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When benchmarking terms query (10000+ terms) on long type, I was supperised to find that the part costing most CPU is to judge whether terms have a decimal part because we execute a double mod for each long. So doing some check before mod may make sense.