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

update performance test to produce same result for both tests #244

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

alaviss
Copy link
Contributor

@alaviss alaviss commented Sep 24, 2021

Main changes:

  • howLong now uses MonoTime to calculate the diff. This is simpler and
    has less overhead than cpuTime, at least.
  • Iterator gains a yielded marker to distinguish between regular jumps
    and jield, with a convienence next() proc to advance the iteration.
  • Changed closure iterator test to one where the parameters are saved.
    This puts it inline with what cps does.
  • Tweaked the termination condition so that it is checked after the
    iteration is run, this is because an iterator "finished" state changes
    after it is run, so using the numbers without checking if it's
    produced by the iterator or its the default due to the iterator ending
    is error prone.

Currently CPS is 3.5x slower than Nim, tested on an AMD Ryzen 5 3600.

Ref #243

Main changes:
- howLong now uses MonoTime to calculate the diff. This is simpler and
  has less overhead than cpuTime, at least.
- `Iterator` gains a yielded marker to distinguish between regular jumps
  and `jield`, with a convienence `next()` proc to advance the iteration.
- Changed closure iterator test to one where the parameters are saved.
  This puts it inline with what cps does.
- Tweaked the termination condition so that it is checked after the
  iteration is run, this is because an iterator "finished" state changes
  after it is run, so using the numbers without checking if it's
  produced by the iterator or its the default due to the iterator ending
  is error prone.

Currently CPS is 3.5x slower than Nim, tested on an AMD Ryzen 5 3600.
@disruptek disruptek enabled auto-merge (squash) September 24, 2021 19:28
@disruptek disruptek added documentation Improvements or additions to documentation refactoring the noblest of deeds labels Sep 24, 2021
@disruptek disruptek merged commit 7891735 into master Sep 24, 2021
@disruptek disruptek deleted the leorize-perf branch September 24, 2021 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation refactoring the noblest of deeds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants