Reduce binary size of ScalarUDFImpl default impls - #24966
Open
simonvandel wants to merge 4 commits into
Open
Conversation
`cargo llvm-lines --release -p datafusion-expr --lib | head -3` Before (1d9a982): ``` Lines Copies Function name ----- ------ ------------- 1247760 26213 (TOTAL) ``` After (f6e650279bc9): ``` Lines Copies Function name ----- ------ ------------- 1247555 26214 (TOTAL) ``` Delta: 1,247,760 -> 1,247,555: -205 (-0.016%); 26,213 -> 26,214: +1 (+0.004%) `cargo build --profile release-nonlto --bin datafusion-cli && stat -f%z ../shared-cargo-target/release-nonlto/datafusion-cli` Before (1d9a982): ``` 186946400 ``` After (f6e650279bc9): ``` 186774176 ``` Delta: 186,946,400 -> 186,774,176: -172,224 (-0.092%)
`cargo llvm-lines --release -p datafusion-expr --lib | head -3` Before (f6e650279bc9): ``` Lines Copies Function name ----- ------ ------------- 1247555 26214 (TOTAL) ``` After (e3ff876dda5f): ``` Lines Copies Function name ----- ------ ------------- 1247423 26215 (TOTAL) ``` Delta: 1,247,555 -> 1,247,423: -132 (-0.011%); 26,214 -> 26,215: +1 (+0.004%) `cargo build --profile release-nonlto --bin datafusion-cli && stat -f%z ../shared-cargo-target/release-nonlto/datafusion-cli` Before (f6e650279bc9): ``` 186774176 ``` After (e3ff876dda5f): ``` 186721568 ``` Delta: 186,774,176 -> 186,721,568: -52,608 (-0.028%)
…m_args) `cargo llvm-lines --release -p datafusion-expr --lib | head -3` Before (e3ff876dda5f): ``` Lines Copies Function name ----- ------ ------------- 1247423 26215 (TOTAL) ``` After (076ea5dba12f): ``` Lines Copies Function name ----- ------ ------------- 1247344 26210 (TOTAL) ``` Delta: 1,247,423 -> 1,247,344: -79 (-0.006%); 26,215 -> 26,210: -5 (-0.019%) `cargo build --profile release-nonlto --bin datafusion-cli && stat -f%z ../shared-cargo-target/release-nonlto/datafusion-cli` Before (e3ff876dda5f): ``` 186721568 ``` After (076ea5dba12f): ``` 186635808 ``` Delta: 186,721,568 -> 186,635,808: -85,760 (-0.046%)
`cargo llvm-lines --release -p datafusion-expr --lib | head -3` Before (076ea5dba12f): ``` Lines Copies Function name ----- ------ ------------- 1247344 26210 (TOTAL) ``` After (7278ffd4fe7f): ``` Lines Copies Function name ----- ------ ------------- 1247097 26207 (TOTAL) ``` Delta: 1,247,344 -> 1,247,097: -247 (-0.020%); 26,210 -> 26,207: -3 (-0.011%) `cargo build --profile release-nonlto --bin datafusion-cli && stat -f%z ../shared-cargo-target/release-nonlto/datafusion-cli` Before (076ea5dba12f): ``` 186635808 ``` After (7278ffd4fe7f): ``` 186574320 ``` Delta: 186,635,808 -> 186,574,320: -61,488 (-0.033%)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24966 +/- ##
==========================================
+ Coverage 81.62% 81.64% +0.01%
==========================================
Files 1124 1125 +1
Lines 412496 413986 +1490
Branches 412496 413986 +1490
==========================================
+ Hits 336710 337984 +1274
- Misses 55967 56091 +124
- Partials 19819 19911 +92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Part of #24727
Rationale for this change
Reduce binary code size by reducing monomorphized code.
What changes are included in this PR?
Extracted non-generic default method body implementations of
ScalarUDFImpl:coerce_typesschema_namereturn_field_from_argsoutput_orderingMeasurements:
cargo llvm-lines --release -p datafusion-expr --lib | head -3Before (1d9a982):
After (7278ffd4fe7f):
cargo build --profile release-nonlto --bin datafusion-cli && stat -f%z ../shared-cargo-target/release-nonlto/datafusion-cliBefore (1d9a982):
After (7278ffd4fe7f):
So 663 fewer LLVM lines, 372 080 fewer bytes (non-lto build of datafusion-cli)
What is the testing strategy for this PR?
Just code-shuffling, no behaviour change.
Are there any user-facing changes?
Slightly binary size, and maybe faster compilation.