Skip to content

Commit

Permalink
29.97 minimum renders per second
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumbub committed Mar 26, 2022
1 parent 10e1488 commit 1263580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ First step towards some advanced JS.

[01c5c850ccef4075d01441983a55cae6aa127c2a](https://github.com/Jumbub/game-of-snails/commit/01c5c850ccef4075d01441983a55cae6aa127c2a)

### Closer towards the C++ code, first "real" benchmark
### Closer towards the C++ code, first "real" benchmark (36.86s)

This benchmark achieves the 30 renders per second requirement, and also adds a check to ensure the average never dips below 29.85.
This benchmark achieves the 30 renders per second requirement, and also adds a check to ensure the average never dips below 29.97.

The code is also another couple steps closer to the C++ algorithm, because we're now storing our cells in the same data structure, and performing the same render calculations.

Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const bench = (
const stop = performance.now();
const seconds = (stop - start) / 1000;
const rps = meta.renders / seconds;
const valid = rps > rendersPerSecond * 0.995 ? '' : '*TOO FEW RENDERS TO BE CONSIDERED VALID*';
const valid = rps > rendersPerSecond * 0.999 ? '' : '*TOO FEW RENDERS TO BE CONSIDERED VALID*';

const report = `seconds: ${seconds.toFixed(2)}s
generations: ${meta.generations}
Expand Down

0 comments on commit 1263580

Please sign in to comment.