-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21751][SQL] CodeGeneraor.splitExpressions counts code size more precisely #18966
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4ac090a
initial commit
kiszk d96f8e5
make threshold configurable
kiszk 87578db
use lines per method as split threshold instead of chars per method
kiszk 073e9e5
update benchmark results
kiszk 63377a6
make a new option effective at runtime
kiszk a489938
rebase with master
kiszk b04c09c
avoid to use SparkEnv.get
kiszk 4c47802
use the original threshold against Java code excluding comments
kiszk 516a72a
revert test case
kiszk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
use lines per method as split threshold instead of chars per method
- Loading branch information
commit 87578dbbd3a497a5962a9c04bd8843e977ccc0fb
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,12 +42,16 @@ class BenchmarkWideTable extends BenchmarkBase { | |
| /** | ||
| * Here are some numbers with different split threshold: | ||
| * | ||
| * Split threshold methods Rate(M/s) Per Row(ns) | ||
| * 10 400 0.4 2279 | ||
| * 100 200 0.6 1554 | ||
| * 1k 37 0.9 1116 | ||
| * 8k 5 0.5 2025 | ||
| * 64k 1 0.0 21649 | ||
| * Split threshold Rate(M/s) Per Row(ns) | ||
| * 10 0.5 2131.3 | ||
| * 20 0.5 2073.7 | ||
| * 40 0.5 2085.2 | ||
| * 64 0.5 2012.2 | ||
| * 80 0.5 2112.2 | ||
| * 100 0.5 1984.0 | ||
| * 128 0.5 2097.9 | ||
| * 256 0.5 2038.9 | ||
| * 1024 0.5 2045.2 | ||
|
||
| */ | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag does not take an effect at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Could you elaborate this review comment?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set the conf to a new value at runtime, can you get the value from
SQLConf.get.maxCodegenLinesPerFunction?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I had another interpretation that "this value may not change performance".
Let me check this while I did it like other flags.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Depends on calling context, it may take an effect or not.
Should we passI am thinking whether we can passSQLConfto this method?SQLConfto a constructor or not.Is there any other thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this option effective by executing
SparkEnv.get.confThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gatorsmile Since to make it configurable takes long time, can we do it using hard-coded parameter?
Even in this case, this PR makes better since the estimation does not include characters for comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiszk You know, I am just afraid new regression could be introduced due to this change. Sorry for the delay. I really do not have a better solution. I kind of agree on your original solution. Just exclude the characters for comment. At least, it becomes better and take a less risk to hit a regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gatorsmile I understand your concern about the possibility of new performance regression. I will use the original threshold (max characters) as hard-coded value.