nickel
nickel copied to clipboard
[Performance] Use primop for the most basic contracts
This is an experimentation that uses primops instead of the most basic contracts (number, booleans, strings and dyn) to see if that makes a difference, performance-wise, rather than have them defined in Nickel. Although they aren't very costly, they should be called a lot, which thus could make a difference.
It seems to show a consistent 2.5% perf improvement on the private bench, both small and big (~4sec eval and ~20sec eval). While it's not nothing, I don't know if it's worth the ad-hoc implementation right now, given that there should be much more meaningful gain by either reducing the memory footprint of Term or by having a first step toward a bytecode VM (let's say, a flattened AST).
Bencher
| Report | Mon, August 5, 2024 at 14:04:29 UTC |
| Project | nickel |
| Branch | 2021/merge |
| Testbed | ubuntu-latest |
⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!
- Latency (latency)
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-thresholdsCLI flag.
Click to view all benchmark results
| Benchmark | Latency | Latency Results nanoseconds (ns) |
|---|---|---|
| fibonacci 10 | ➖ (view plot) | 498,560.00 |
| pidigits 100 | ➖ (view plot) | 3,206,800.00 |
| product 30 | ➖ (view plot) | 793,380.00 |
| scalar 10 | ➖ (view plot) | 1,475,400.00 |
| sum 30 | ➖ (view plot) | 792,550.00 |
Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help
Given the limited improvement, I'm closing this experiment.