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

Compare the size of libraries in the benchmark #58

Open
stasm opened this issue Feb 4, 2022 · 1 comment
Open

Compare the size of libraries in the benchmark #58

stasm opened this issue Feb 4, 2022 · 1 comment

Comments

@stasm
Copy link
Contributor

stasm commented Feb 4, 2022

How about displaying the size of each test case, including the code pulled in from the tested library, next to the performance results? I think it might be interesting to see how performance relates to the amount of code.

Disclaimer: As the author of Goodluck, I'm obviously biased. Goodluck has been designed with size-constrained use-cases in mind, and it compares favorably to other libraries in the benchmark. I won't mind it if you think this isn't helpful.

Size computation could be done with help of a bundling tool like esbuild, for example. Here's a Bash one-liner to give a sense of the spectrum of current results.

# Precondition: npm install esbuild.
find src/cases -name "*.js" | while read casePath; do
    echo "${casePath#src/cases/}";
    npx esbuild $casePath --bundle --minify | wc -c;
done
[Output as of d043805, in bytes]
becsy/entity_cycle.js
   55517
becsy/simple_iter.js
   56098
becsy/frag_iter.js
   55558
becsy/packed_1.js
   55448
becsy/add_remove.js
   55452
becsy/packed_5.js
   56034
picoes/entity_cycle.js
    5319
picoes/simple_iter.js
    5676
picoes/frag_iter.js
    5422
picoes/packed_1.js
    5376
picoes/add_remove.js
    5243
picoes/packed_5.js
    5510
wolf-ecs/entity_cycle.js
    5916
wolf-ecs/simple_iter.js
    6553
wolf-ecs/frag_iter.js
    6012
wolf-ecs/packed_1.js
    5931
wolf-ecs/add_remove.js
    5901
wolf-ecs/packed_5.js
    6567
piecs/entity_cycle.js
    7493
piecs/simple_iter.js
    8083
piecs/frag_iter.js
    7587
piecs/packed_1.js
    7483
piecs/add_remove.js
    7480
piecs/packed_5.js
    7995
perform-ecs/entity_cycle.js
    6556
perform-ecs/simple_iter.js
    7259
perform-ecs/frag_iter.js
    6603
perform-ecs/packed_1.js
    6648
perform-ecs/add_remove.js
    6581
perform-ecs/packed_5.js
    7268
ecsy/entity_cycle.js
   22070
ecsy/simple_iter.js
   23034
ecsy/frag_iter.js
   22181
ecsy/packed_1.js
   22239
ecsy/add_remove.js
   22027
ecsy/packed_5.js
   22939
goodluck/entity_cycle.js
    1457
goodluck/simple_iter.js
    2140
goodluck/frag_iter.js
    1636
goodluck/packed_1.js
    1715
goodluck/add_remove.js
    1303
goodluck/packed_5.js
    2031
bitecs/entity_cycle.js
    9166
bitecs/simple_iter.js
    9704
bitecs/frag_iter.js
    9143
bitecs/packed_1.js
    9060
bitecs/add_remove.js
    9469
bitecs/packed_5.js
    9571
javelin-ecs/entity_cycle.js
   15524
javelin-ecs/simple_iter.js
   16127
javelin-ecs/frag_iter.js
   15600
javelin-ecs/packed_1.js
   15548
javelin-ecs/add_remove.js
   15483
javelin-ecs/packed_5.js
   15898
uecs/entity_cycle.js
    3401
uecs/simple_iter.js
    3743
uecs/frag_iter.js
    3527
uecs/packed_1.js
    3470
uecs/add_remove.js
    3363
uecs/packed_5.js
    3614
harmony-ecs/entity_cycle.js
   10585
harmony-ecs/simple_iter.js
   10919
harmony-ecs/frag_iter.js
   10622
harmony-ecs/packed_1.js
   10550
harmony-ecs/add_remove.js
   10582
harmony-ecs/packed_5.js
   10945
geotic/entity_cycle.js
   10980
geotic/simple_iter.js
   11571
geotic/frag_iter.js
   11115
geotic/packed_1.js
   11111
geotic/add_remove.js
   10940
geotic/packed_5.js
   11355
tiny-ecs/entity_cycle.js
   14711
tiny-ecs/simple_iter.js
   15291
tiny-ecs/frag_iter.js
   14831
tiny-ecs/packed_1.js
   14778
tiny-ecs/add_remove.js
   14663
tiny-ecs/packed_5.js
   14978
@EnderShadow8
Copy link
Contributor

Might also be a good idea to exclude the library code to compare verbosity, although that might encourage slight golfing of cases.

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

No branches or pull requests

2 participants