-
Notifications
You must be signed in to change notification settings - Fork 847
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
davidmarkclements
committed
May 12, 2018
1 parent
06872ae
commit 11cb8ab
Showing
5 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict' | ||
|
||
var bench = require('fastbench') | ||
var pino = require('../') | ||
|
||
var epoch = pino({timestamp: pino.stdTimeFunctions.epochTime}, pino.destination('/dev/null')) | ||
var unix = pino({timestamp: pino.stdTimeFunctions.unixTime}, pino.destination('/dev/null')) | ||
var utc = pino({timestamp: pino.stdTimeFunctions.utcTime}, pino.destination('/dev/null')) | ||
|
||
var max = 100 | ||
|
||
var run = bench([ | ||
function benchPinoEpochTime (cb) { | ||
for (var i = 0; i < max; i++) { | ||
epoch.info('hello world') | ||
} | ||
setImmediate(cb) | ||
}, | ||
function benchPinoUnixTime (cb) { | ||
for (var i = 0; i < max; i++) { | ||
unix.info('hello world') | ||
} | ||
setImmediate(cb) | ||
}, | ||
function benchPinoUtcTime (cb) { | ||
for (var i = 0; i < max; i++) { | ||
utc.info('hello world') | ||
} | ||
setImmediate(cb) | ||
} | ||
], 10000) | ||
|
||
run(run) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters