Commit a02e683
authored
Reduce number of traversals per node in
## Which issue does this PR close?
- Closes #20081.
## Rationale for this change
Ran into this while investigating #20078, in my benchmarks this saves
around %10, which can quickly add up to a few ms per query.
The benchmarking code is
[here](https://gist.github.com/AdamGS/4fc6612814786a95a673378de7d61202),
measuring it on my laptop the effect is:
```
tpc-ds/q76/cs/16 time: [927.65 µs 928.86 µs 930.14 µs]
change: [−12.309% −11.983% −11.667%] (p = 0.00 < 0.05)
Performance has improved.
tpc-ds/q76/ws/16 time: [929.00 µs 930.51 µs 932.13 µs]
change: [−12.102% −11.808% −11.475%] (p = 0.00 < 0.05)
tpc-ds/q76/cs/128 time: [6.8376 ms 6.8460 ms 6.8552 ms]
change: [−12.626% −12.411% −12.207%] (p = 0.00 < 0.05)
tpc-ds/q76/ws/128 time: [6.8394 ms 6.8536 ms 6.8710 ms]
change: [−12.039% −11.813% −11.575%] (p = 0.00 < 0.05)
```
## What changes are included in this PR?
I've also changed `[cfg(test)]` to a debug assertion, which seems more
in the spirit of #18001, and
will make the check fail even if a test in another crate triggers, which
effectively increases the coverage.
## Are these changes tested?
The functionality is identical, and in addition to existing tests I've
changed the defensive assertion into a debug check and ran tests for
other crates that make use of this codepath (like
`datafusion-datasource-parquet` and `datafusion-pruning`).
## Are there any user-facing changes?
NonePhysicalExprSimplifier (#20082)1 parent 4a63659 commit a02e683
2 files changed
Lines changed: 19 additions & 4 deletions
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
| 45 | + | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
0 commit comments