Commit d919d57
committed
perf: Add Arc::ptr_eq short-circuit to DType equality comparisons
FieldName, FieldNames, and StructFields all wrap Arc types but their
derived PartialEq always dereferences through the Arc to compare
contents. Since DTypes are frequently cloned (every slice, filter,
execute copies the DType), the cloned Arcs share pointers — making
pointer equality a reliable fast path.
This is especially impactful for struct DTypes with many fields (e.g.
ClickBench's 105-column `hits` table), where each DType comparison
previously required 105 string comparisons through Arc indirection.
DataFusion ClickBench full-suite apmc measurement (vortex):
- Cycles: -6.3% (861B → 807B)
- IPC: +6.7% (1.88 → 2.01)
- MAP_STALL: -7.2% (360B → 334B)
- Instructions: unchanged (same code paths, just early exit)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>1 parent 3bdb376 commit d919d57
3 files changed
Lines changed: 27 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9758 | 9758 | | |
9759 | 9759 | | |
9760 | 9760 | | |
9761 | | - | |
| 9761 | + | |
9762 | 9762 | | |
9763 | 9763 | | |
9764 | 9764 | | |
| |||
9832 | 9832 | | |
9833 | 9833 | | |
9834 | 9834 | | |
9835 | | - | |
9836 | | - | |
9837 | 9835 | | |
9838 | 9836 | | |
9839 | 9837 | | |
| |||
9858 | 9856 | | |
9859 | 9857 | | |
9860 | 9858 | | |
9861 | | - | |
| 9859 | + | |
9862 | 9860 | | |
9863 | 9861 | | |
9864 | 9862 | | |
| |||
9928 | 9926 | | |
9929 | 9927 | | |
9930 | 9928 | | |
9931 | | - | |
9932 | | - | |
9933 | 9929 | | |
9934 | 9930 | | |
9935 | 9931 | | |
| |||
10170 | 10166 | | |
10171 | 10167 | | |
10172 | 10168 | | |
10173 | | - | |
| 10169 | + | |
10174 | 10170 | | |
10175 | 10171 | | |
10176 | 10172 | | |
| |||
10188 | 10184 | | |
10189 | 10185 | | |
10190 | 10186 | | |
10191 | | - | |
10192 | | - | |
10193 | 10187 | | |
10194 | 10188 | | |
10195 | 10189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
139 | 146 | | |
140 | 147 | | |
141 | 148 | | |
142 | | - | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
144 | 151 | | |
145 | 152 | | |
146 | 153 | | |
| |||
0 commit comments