@@ -3,49 +3,46 @@ const bench = require('fastbench')
33const max = JSON . parse ( process . env . MAX || 10000 )
44const stream = max === 1 ? process . stderr : undefined
55
6- const {
7- bunyan,
8- debug,
9- pino,
10- pinoAsync,
11- debugLevel,
12- debugLevelAsync
13- } = require ( './instances.js' ) ( stream )
6+ const { bunyan, debug, pino, pinoAsync, debugLevel, debugLevelAsync } =
7+ require ( './instances.js' ) ( stream )
148
159const deep = require ( '../package.json' )
1610deep . deep = Object . assign ( { } , JSON . parse ( JSON . stringify ( deep ) ) )
1711deep . deep . deep = Object . assign ( { } , JSON . parse ( JSON . stringify ( deep ) ) )
1812
19- const run = bench ( [
20- function benchDebug ( done ) {
21- debug ( 'deep %j' , deep )
22- process . nextTick ( done )
23- } ,
24- function benchBunyan ( done ) {
25- bunyan . debug ( 'deep %j' , deep )
26- process . nextTick ( done )
27- } ,
28- function benchPino ( done ) {
29- pino . debug ( 'deep %j' , deep )
30- process . nextTick ( done )
31- } ,
32- function benchDebugLevel ( done ) {
33- debugLevel . debug ( 'deep %j' , deep )
34- process . nextTick ( done )
35- } ,
36- function benchPinoAsync ( done ) {
37- pinoAsync . debug ( 'deep %j' , deep )
38- process . nextTick ( done )
39- } ,
40- function benchDebugLevelAsync ( done ) {
41- debugLevelAsync . debug ( 'deep %j' , deep )
42- process . nextTick ( done )
43- }
44- ] , max )
13+ const run = bench (
14+ [
15+ function benchDebug ( done ) {
16+ debug ( 'deep %j' , deep )
17+ process . nextTick ( done )
18+ } ,
19+ function benchBunyan ( done ) {
20+ bunyan . debug ( 'deep %j' , deep )
21+ process . nextTick ( done )
22+ } ,
23+ function benchPino ( done ) {
24+ pino . debug ( 'deep %j' , deep )
25+ process . nextTick ( done )
26+ } ,
27+ function benchDebugLevel ( done ) {
28+ debugLevel . debug ( 'deep %j' , deep )
29+ process . nextTick ( done )
30+ } ,
31+ function benchPinoAsync ( done ) {
32+ pinoAsync . debug ( 'deep %j' , deep )
33+ process . nextTick ( done )
34+ } ,
35+ function benchDebugLevelAsync ( done ) {
36+ debugLevelAsync . debug ( 'deep %j' , deep )
37+ process . nextTick ( done )
38+ }
39+ ] ,
40+ max
41+ )
4542
4643const final = ( ) => {
4744 pinoAsync . flush ( )
4845 debugLevelAsync . flush ( )
4946}
5047
51- run ( ( final ) )
48+ run ( final )
0 commit comments