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

Benchmark lazy infinite sieve of Eratosthenes #11351

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Oct 17, 2024

Pull Request Description

Benchmark using lazy atom field to compute sieve of Eratosthnes. Demo of heapdumping with Enso and Insight.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the Enso style guides.
  • All code follows the JavaScript style guides.
  • All code follows the Scala style guides.
  • Benchmark run of sieve benchmarks is OK.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Oct 17, 2024
@JaroslavTulach JaroslavTulach self-assigned this Oct 17, 2024
@JaroslavTulach JaroslavTulach force-pushed the wip/jtulach/BenchLazySieve branch from c1f7d1c to 2afcfa5 Compare October 17, 2024 15:04
//
// This GraalVM script waits for the end execution of `compute_and_print_nth` function
// to store value of its `p` local variable (containing linked list of prime numbers)
// into `/tmp/sieve.hprof` - a GraalVM serialization for Truffle languages!
Copy link
Member Author

@JaroslavTulach JaroslavTulach Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To generate this heap dump execute:

sbt:enso> runEngineDistribution --vm.D=polyglot.heap.dump=/tmp/sieve.hprof --vm.D=polyglot.insight=Benchmarks/src/Sieve/heap_dump_lazy_sieve.js --run test/Benchmarks/src/Sieve/Lazy_Sieve.enso 10000

This is how the heap dump looks like in VisualVM:

Enso heap in VisualVM

@enso-bot
Copy link

enso-bot bot commented Oct 18, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-10-17):

Progress: .

GitHub
Pull Request Description Benchmark using lazy atom field to compute sieve of Eratosthnes. Demo of heapdumping with Enso and Insight. Checklist Please ensure that the following checklist has been sa...

@JaroslavTulach
Copy link
Member Author

Benchmarks do run. Surprisingly the "lazy sieve" is faster than classical one. 323ms vs. 426ms.

@JaroslavTulach JaroslavTulach merged commit ed12224 into develop Oct 18, 2024
35 of 36 checks passed
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/BenchLazySieve branch October 18, 2024 15:46
@enso-bot
Copy link

enso-bot bot commented Oct 19, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-10-18):

Progress: .

Discord
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.

@enso-bot
Copy link

enso-bot bot commented Oct 21, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-10-20):

Progress: .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants