Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Performance] Use primop for the most basic contracts #2021

Closed
wants to merge 1 commit into from

Conversation

yannham
Copy link
Member

@yannham yannham commented Aug 5, 2024

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.

@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 13:59 Inactive
@yannham
Copy link
Member Author

yannham commented Aug 5, 2024

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).

Copy link
Contributor

github-actions bot commented Aug 5, 2024

🐰Bencher

ReportMon, August 5, 2024 at 14:04:29 UTC
Projectnickel
Branch2021/merge
Testbedubuntu-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-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencyLatency 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

@yannham
Copy link
Member Author

yannham commented Sep 9, 2024

Given the limited improvement, I'm closing this experiment.

@yannham yannham closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant