Repository navigation
Commit 01a3a71
committed
Build the path of a component found through an open with its binding
Why:
Id_tbl.find_opened returned the binding and its position as a new
pair, which find_name and find_all took apart again to build the
path, so every lookup of a name found in the components of an open
allocated three words more than before the open tables took the
cells. In stress/RefsInLoop
that moved each statement's allocations from 46272 to 46368 bytes, a
Fibonacci number: with the minor heap the benchmarks run with, the
objects of the 300 statements in the .cmt then fall on the same slot of
the marshaller's position table (Fibonacci hashing of addresses, linear
probing), and marshalling the .cmt took about 40M more instructions
(+23% under cachegrind), though the file is byte-identical.
find_opened now gives the path and the binding, built from the pair stored
in the table; update, which only Env.copy_types calls, looks the binding up
as before. The bindings found, their order and the outputs are unchanged.
Measured with scripts/compilerBenchmarks.js against the previous commit:
allocated words -0.02% in total, stress/NestedClosures -0.13%, and
stress/RefsInLoop -5.4K words; with perf stat (s=64M as the benchmarks
run) RefsInLoop takes 456.5M instructions, against 515.0M before and 456.1M
for #9192 head.
Review: Does the instruction count of RefsInLoop now depend on luck? Yes,
as before #9194: any change of 96 bytes per statement in this benchmark
can land on a stride that hashes badly, without any work in the compiler.
The fix removes the allocation that moved it there, which is worth having
on its own.
Signed-off-by: Jono Prest <jjprest@gmail.com>1 parent da4ff72 commit 01a3a71
1 file changed
Lines changed: 18 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
303 | 304 | | |
304 | | - | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | | - | |
| 308 | + | |
308 | 309 | | |
309 | | - | |
| 310 | + | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
| |||
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
331 | | - | |
| 332 | + | |
332 | 333 | | |
333 | | - | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
| |||
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
371 | | - | |
| 377 | + | |
372 | 378 | | |
373 | | - | |
| 379 | + | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| |||
0 commit comments