jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" />
const NON_PLURAL_WORDS = Object.freeze(['ADDRESS']);
const isPlural = (word) => word.endsWith('S') && !NON_PLURAL_WORDS.includes(word);
const isPlural2 = _.memoize(isPlural);
const words = const words = ['MESSAGE', 'DEAL_SETS', 'DEAL_SET', 'DEALS', 'DEAL', 'ASSETS', 'ASSET', 'ASSET_DETAIL', 'COLLATERALS', 'COLLATERAL', 'SUBJECT_PROPERTY', 'ADDRESS', 'PROPERTY_DETAIL']
Ready to run.
Test | Ops/sec | |
---|---|---|
isPlural |
| ready |
Memoized isPlural |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.