Commit 96c8cc5
libexpr/meson: Rice the compiler inlining heuristics to improve perf of the bison generated parser
Turns out both GCC and Clang need a bit of hand-holding to optimize the bison generated
code well, otherwise parser performance tanks.
(Comparisons against baseline in 7e8db2e):
For GCC:
Benchmark 1 (15 runs): result/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 335ms ± 2.89ms 332ms … 342ms 0 ( 0%) 0%
Benchmark 2 (16 runs): result-old/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 330ms ± 2.87ms 326ms … 337ms 0 ( 0%) - 1.4% ± 0.6%
For Clang:
Benchmark 1 (15 runs): result-clang/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 340ms ± 1.43ms 338ms … 343ms 0 ( 0%) 0%
Benchmark 2 (15 runs): result-old-clang/bin/nix-instantiate --parse ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
measurement mean ± σ min … max outliers delta
wall_time 334ms ± 1.61ms 332ms … 338ms 0 ( 0%) ⚡- 1.7% ± 0.3%1 parent 32b286e commit 96c8cc5
1 file changed
+47
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
186 | 230 | | |
187 | 231 | | |
188 | 232 | | |
189 | 233 | | |
190 | | - | |
191 | | - | |
| 234 | + | |
| 235 | + | |
192 | 236 | | |
193 | 237 | | |
194 | 238 | | |
195 | 239 | | |
196 | 240 | | |
| 241 | + | |
197 | 242 | | |
198 | 243 | | |
199 | 244 | | |
| |||
0 commit comments