tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.43k stars 93 forks source link

[RFC007] Fix the representation of Ast: remove inner indirection #2082

Closed yannham closed 3 weeks ago

yannham commented 3 weeks ago

Depends on #2080.

bytecode::ast::Ast wasn't following the general approach that we set for designing other datastructures of the ast: use references within enums to avoid size bloat, but use owned data in structures to avoid indirection (since structures are packed).

Ast was doing something different, pushing the reference inside the individual fields to make a relatively thin pointer around Node and store that datastructure inline in the Node enum. While this essentially doesn't make a huge difference, we rather follow our simple general rule. Additionally, other data structures such as bytecode::ast:typ::Type follows the simple general rule, and we would rather do the same thing everywhere in a consistent manner.

Doing so, this commit also cleans a bit the interface of AstAlloc to reflect the ownership change and to get rid of some variations of methods in the sake of simplicity.

github-actions[bot] commented 3 weeks ago

🐰 Bencher Report

Branch2082/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
fibonacci 10📈 view plot
⚠️ NO THRESHOLD
503,120.00
foldl arrays 50📈 view plot
⚠️ NO THRESHOLD
1,695,400.00
foldl arrays 500📈 view plot
⚠️ NO THRESHOLD
6,545,500.00
foldr strings 50📈 view plot
⚠️ NO THRESHOLD
7,088,500.00
foldr strings 500📈 view plot
⚠️ NO THRESHOLD
61,905,000.00
generate normal 250📈 view plot
⚠️ NO THRESHOLD
45,631,000.00
generate normal 50📈 view plot
⚠️ NO THRESHOLD
2,063,600.00
generate normal unchecked 1000📈 view plot
⚠️ NO THRESHOLD
3,325,600.00
generate normal unchecked 200📈 view plot
⚠️ NO THRESHOLD
752,150.00
pidigits 100📈 view plot
⚠️ NO THRESHOLD
3,234,500.00
pipe normal 20📈 view plot
⚠️ NO THRESHOLD
1,498,400.00
pipe normal 200📈 view plot
⚠️ NO THRESHOLD
9,955,300.00
product 30📈 view plot
⚠️ NO THRESHOLD
820,140.00
scalar 10📈 view plot
⚠️ NO THRESHOLD
1,500,200.00
sum 30📈 view plot
⚠️ NO THRESHOLD
808,270.00
🐰 View full continuous benchmarking report in Bencher
dpulls[bot] commented 3 weeks ago

:tada: All dependencies have been resolved !