.selectVS.eachVS.count
.selectVS.eachVS.count
Benchmark to test the performance difference between Hash.select, Hash.values.count, and the old fashion .each iterator
Usage
crystal selectvseachvscount.cr --release
Current Results:
Final Thoughts
- Looks like the old fashion .each iterator and .count are beasts! Assuming the benchmark is not skewed and correct (please submit a new PR to fix)
- Also seems like, sometimes developers can fall into the trap of using
.select. However, if you just need to obtain the size of a hash / array,.count, and.eachare much faster.
Contributing
- This is still a work in progress, if you can enhance this benchmark please submit a PR or issue, thanks!
- Thanks for stopping by!
Repository
.selectVS.eachVS.count
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- about 6 years ago
- October 8, 2019
License
Links
Synced at
Tue, 28 Oct 2025 07:24:30 GMT
Languages
