fdsfd
This commit is contained in:
parent
628618df89
commit
e031240dff
3749 changed files with 1120848 additions and 1 deletions
30
node_modules/reusify/benchmarks/createNoCodeFunction.js
generated
vendored
Normal file
30
node_modules/reusify/benchmarks/createNoCodeFunction.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
'use strict'
|
||||
|
||||
var fib = require('./fib')
|
||||
var max = 100000000
|
||||
var start = Date.now()
|
||||
|
||||
// create a funcion with the typical error
|
||||
// pattern, that delegates the heavy load
|
||||
// to something else
|
||||
function createNoCodeFunction () {
|
||||
/* eslint no-constant-condition: "off" */
|
||||
var num = 100
|
||||
|
||||
;(function () {
|
||||
if (null) {
|
||||
// do nothing
|
||||
} else {
|
||||
fib(num)
|
||||
}
|
||||
})()
|
||||
}
|
||||
|
||||
for (var i = 0; i < max; i++) {
|
||||
createNoCodeFunction()
|
||||
}
|
||||
|
||||
var time = Date.now() - start
|
||||
console.log('Total time', time)
|
||||
console.log('Total iterations', max)
|
||||
console.log('Iteration/s', max / time * 1000)
|
Loading…
Add table
Add a link
Reference in a new issue