Repository navigation
Commit 70346d0
authored
Make
## Which issue does this PR close?
- Part of apache#24727
## Rationale for this change
The default `udaf_default_*` display / schema name helpers in
`datafusion/expr/src/udaf.rs` are instantiated for each UDAF
## What changes are included in this PR?
1. Move the default implementations of the five display / schema name
methods into non-generic builder structs so each body is compiled only
once
2. Update the `AggregateUDFImpl` default methods to use the builders
3. Mark existing functions as deprecated
4. Add a doc example
## Code size
Measured per the methodology in apache#24727, at merge base d66f4b9 and on
this branch (39d0e53).
`cargo llvm-lines --release -p datafusion-functions-aggregate --lib` (29
`AggregateUDFImpl` implementations):
| | main (d66f4b9) | this branch | change |
| ------------------------------ | ---------------------- |
----------------- | ---------------------- |
| `udaf_default_*` display/schema name helpers | 212,048 IR lines (2,755
functions) | 0 | **-212,048 (-100%)** |
| Crate total | 2,112,337 IR lines (39,704 copies) | 1,900,949 IR lines
(36,936 copies) | **-211,388 (-10.0%)** |
`cargo llvm-lines --release -p datafusion-expr --lib` (the builder
bodies now compile here exactly once):
| | main (d66f4b9) | this branch | change |
| ----------- | ------------------ | ------------------ |
------------------- |
| Crate total | 1,265,863 IR lines (26,406 copies) | 1,229,636 IR lines
(25,925 copies) | **-36,227 (-2.9%)** |
`cargo build --release --bin datafusion-cli`:
| | main (d66f4b9) | this branch (39d0e53) | change |
| ----------- | ----------------- | --------------------------- |
--------------------------- |
| Binary size | 81,580,368 bytes | 81,365,536 bytes | **-214,832 bytes
(-0.26%)** |
## Are these changes tested?
Covered by existing tests
## Are there any user-facing changes?
Yes, but not breaking:udaf_default_* display/schema name helpers non-generic (214 KB smaller binary) (apache#24728)1 parent 9b05156 commit 70346d0
2 files changed
Lines changed: 457 additions & 200 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| |||
0 commit comments