https://github.com/joakin/js-data-oriented-benchmark
Benchmark to see if data oriented design in JS can pay off
https://github.com/joakin/js-data-oriented-benchmark
Last synced: about 1 year ago
JSON representation
Benchmark to see if data oriented design in JS can pay off
- Host: GitHub
- URL: https://github.com/joakin/js-data-oriented-benchmark
- Owner: joakin
- Created: 2020-02-17T12:29:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-17T12:29:52.000Z (over 6 years ago)
- Last Synced: 2025-02-18T19:55:38.321Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Benchmark to see if data oriented design in JS can pay off
How to run:
npm install
NODE_ENV=production node index.js
Some runs on my laptop:
```
js-data-oriented-benchmark → NODE_ENV=production node index.js
typed array x 409 ops/sec ±1.13% (82 runs sampled)
array x 402 ops/sec ±1.06% (81 runs sampled)
structure of array x 430 ops/sec ±0.92% (80 runs sampled)
array of structure x 390 ops/sec ±0.56% (83 runs sampled)
Fastest is structure of array
js-data-oriented-benchmark → NODE_ENV=production node index.js
typed array x 404 ops/sec ±0.82% (80 runs sampled)
array x 404 ops/sec ±0.90% (79 runs sampled)
array of structure x 392 ops/sec ±1.10% (84 runs sampled)
structure of array x 403 ops/sec ±0.96% (81 runs sampled)
Fastest is array,typed array,structure of array
js-data-oriented-benchmark → NODE_ENV=production node index.js
typed array x 431 ops/sec ±0.56% (83 runs sampled)
array x 452 ops/sec ±0.25% (85 runs sampled)
array of structure x 394 ops/sec ±1.17% (84 runs sampled)
structure of array x 403 ops/sec ±1.04% (82 runs sampled)
Fastest is array
js-data-oriented-benchmark → NODE_ENV=production node index.js
typed array x 421 ops/sec ±1.10% (83 runs sampled)
array x 435 ops/sec ±1.09% (83 runs sampled)
array of structure x 384 ops/sec ±1.15% (83 runs sampled)
structure of array x 411 ops/sec ±0.48% (84 runs sampled)
Fastest is array
```
🤷♂️