Skip to content

Instantly share code, notes, and snippets.

@ambroseus
Created October 10, 2020 07:52
Show Gist options
  • Save ambroseus/9396ed93bd2af65866de5eabbc9f1e97 to your computer and use it in GitHub Desktop.
Save ambroseus/9396ed93bd2af65866de5eabbc9f1e97 to your computer and use it in GitHub Desktop.
variants benchmark
const imVariants = require('./variants-im')
const fnVariants = require('./variants-fn')
const str = '012345678901234'
count = 100
console.time('imperative variants');
for (let i = 0; i < count; i++) {
imVariants(str)
}
console.timeEnd('imperative variants');
console.time('functional variants');
for (let i = 0; i < count; i++) {
fnVariants(str)
}
console.timeEnd('functional variants')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment