Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino

Package Overview
Dependencies
Maintainers
2
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino - npm Package Compare versions

Comparing version 2.4.3 to 2.4.4

benchmarks/loglevelMock.js

18

benchmarks/basic.js

@@ -10,2 +10,3 @@ 'use strict'

var dest = fs.createWriteStream('/dev/null')
var loglevel = require('./loglevelMock')(dest)
var plog = pino(dest)

@@ -15,2 +16,7 @@ delete require.cache[require.resolve('../')]

process.env.DEBUG = 'dlog'
var debug = require('debug')
var dlog = debug('dlog')
dlog.log = function (s) { dest.write(s) }
var max = 10

@@ -52,2 +58,14 @@ var blog = bunyan.createLogger({

},
function benchDebug (cb) {
for (var i = 0; i < max; i++) {
dlog('hello world')
}
setImmediate(cb)
},
function benchLogLevel (cb) {
for (var i = 0; i < max; i++) {
loglevel.info('hello world')
}
setImmediate(cb)
},
function benchPino (cb) {

@@ -54,0 +72,0 @@ for (var i = 0; i < max; i++) {

@@ -18,2 +18,4 @@ 'use strict'

var loglevel = require('./loglevelMock')(dest)
var deep = require('../package.json')

@@ -60,2 +62,8 @@ deep.deep = Object.assign({}, deep)

},
function benchLogLevelDeepObj (cb) {
for (var i = 0; i < max; i++) {
loglevel.info(deep)
}
setImmediate(cb)
},
function benchPinoDeepObj (cb) {

@@ -62,0 +70,0 @@ for (var i = 0; i < max; i++) {

@@ -10,2 +10,3 @@ 'use strict'

var dest = fs.createWriteStream('/dev/null')
var loglevel = require('./loglevelMock')(dest)
var plog = pino(dest)

@@ -19,2 +20,7 @@ delete require.cache[require.resolve('../')]

process.env.DEBUG = 'dlog'
var debug = require('debug')
var dlog = debug('dlog')
dlog.log = function (s) { dest.write(s) }
var deep = require('../package.json')

@@ -61,2 +67,14 @@ deep.deep = Object.assign({}, deep)

},
function benchLogLevelMulti (cb) {
for (var i = 0; i < max; i++) {
loglevel.info('hello', 'world')
}
setImmediate(cb)
},
function benchDebugMulti (cb) {
for (var i = 0; i < max; i++) {
dlog('hello', 'world')
}
setImmediate(cb)
},
function benchPinoMulti (cb) {

@@ -74,2 +92,8 @@ for (var i = 0; i < max; i++) {

},
function benchDebugInterpolate (cb) {
for (var i = 0; i < max; i++) {
dlog('hello %s', 'world')
}
setImmediate(cb)
},
function benchBunyanInterpolate (cb) {

@@ -111,2 +135,8 @@ for (var i = 0; i < max; i++) {

},
function benchDebugInterpolateAll (cb) {
for (var i = 0; i < max; i++) {
dlog('hello %s %j %d', 'world', {obj: true}, 4)
}
setImmediate(cb)
},
function benchWinstonInterpolateAll (cb) {

@@ -124,2 +154,8 @@ for (var i = 0; i < max; i++) {

},
function benchLogLevelInterpolateAll (cb) {
for (var i = 0; i < max; i++) {
loglevel.info('hello %s %j %d', 'world', {obj: true}, 4)
}
setImmediate(cb)
},
function benchPinoInterpolateAll (cb) {

@@ -149,2 +185,8 @@ for (var i = 0; i < max; i++) {

},
function benchDebugInterpolateExtra (cb) {
for (var i = 0; i < max; i++) {
dlog('hello %s %j %d', 'world', {obj: true}, 4, {another: 'obj'})
}
setImmediate(cb)
},
function benchBunyanInterpolateExtra (cb) {

@@ -168,2 +210,8 @@ for (var i = 0; i < max; i++) {

},
function benchLogLevelInterpolateExtra (cb) {
for (var i = 0; i < max; i++) {
loglevel.info('hello %s %j %d', 'world', {obj: true}, 4, {another: 'obj'})
}
setImmediate(cb)
},
function benchPinoInterpolateExtra (cb) {

@@ -193,2 +241,8 @@ for (var i = 0; i < max; i++) {

},
function benchDebugInterpolateDeep (cb) {
for (var i = 0; i < max; i++) {
dlog('hello %j', deep)
}
setImmediate(cb)
},
function benchBunyanInterpolateDeep (cb) {

@@ -212,2 +266,8 @@ for (var i = 0; i < max; i++) {

},
function benchLogLevelInterpolateDeep (cb) {
for (var i = 0; i < max; i++) {
loglevel.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoInterpolateDeep (cb) {

@@ -214,0 +274,0 @@ for (var i = 0; i < max; i++) {

@@ -10,2 +10,3 @@ 'use strict'

var dest = fs.createWriteStream('/dev/null')
var loglevel = require('./loglevelMock')(dest)
var plog = pino(dest)

@@ -55,2 +56,8 @@ delete require.cache[require.resolve('../')]

},
function benchLogLevelObject (cb) {
for (var i = 0; i < max; i++) {
loglevel.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoObj (cb) {

@@ -57,0 +64,0 @@ for (var i = 0; i < max; i++) {

6

package.json
{
"name": "pino",
"version": "2.4.3",
"version": "2.4.4",
"description": "fast and simple logger",

@@ -36,7 +36,9 @@ "main": "pino.js",

"bunyan": "^1.6.0",
"debug": "^2.2.0",
"fastbench": "^1.0.0",
"flush-write-stream": "^1.0.0",
"log": "^1.4.0",
"loglevel": "^1.4.0",
"pre-commit": "^1.1.2",
"standard": "^6.0.5",
"standard": "^7.0.0",
"tap": "^5.5.0",

@@ -43,0 +45,0 @@ "winston": "^2.1.1"

@@ -80,7 +80,9 @@ # pino&nbsp;&nbsp;[![Build Status](https://travis-ci.org/mcollina/pino.svg)](https://travis-ci.org/mcollina/pino)

```
benchBunyan*10000: 1082.896ms
benchWinston*10000: 1707.665ms
benchBole*10000: 1574.295ms
benchPino*10000: 264.506ms
benchPinoExreme*10000: 105.391ms
benchBunyan*10000: 1140ms
benchWinston*10000: 1888ms
benchBole*10000: 1594ms
benchDebug*10000: 390ms
benchLogLevel*10000: 371ms
benchPino*10000: 291ms
benchPinoExreme*10000: 115ms
```

@@ -91,7 +93,10 @@

```
benchBunyanObj*10000: 1213.984ms
benchWinstonObj*10000: 1951.889ms
benchBoleObj*10000: 1717.641ms
benchPinoObj*10000: 322.118ms
benchPinoExtremeObj*10000: 142.215ms
benchBunyanObj*10000: 1355ms
benchWinstonObj*10000: 2012ms
benchBoleObj*10000: 1614ms
benchLogLevelObject*10000: 1456ms
benchPinoObj*10000: 369ms
benchPinoUnsafeObj*10000: 353ms
benchPinoExtremeObj*10000: 165ms
benchPinoUnsafeExtremeObj*10000: 158ms
```

@@ -101,9 +106,2 @@

```
benchBunyanDeepObj*10000: 6148.665ms
benchWinstonDeepObj*10000: 14726.129ms
benchBoleDeepObj*10000: 24450.814ms
benchPinoDeepObj*10000: 4296.618ms
benchPinoUnsafeDeepObj*10000: 3065.568ms
benchPinoExtremeDeepObj*10000: 4139.848ms
benchPinoUnsafeExtremeDeepObj*10000: 2948.078ms
```

@@ -114,7 +112,11 @@

```
benchBunyanInterpolateExtra*10000: 2665.294ms
benchWinstonInterpolateExtra*10000: 2455.395ms
benchBoleInterpolateExtra*10000: 3291.087ms
benchPinoInterpolateExtra*10000: 568.122ms
benchPinoExtremeInterpolateExtra*10000: 341.009ms
benchDebugInterpolateExtra*10000: 735ms
benchBunyanInterpolateExtra*10000: 2978ms
benchWinstonInterpolateExtra*10000: 2644ms
benchBoleInterpolateExtra*10000: 3564ms
benchLogLevelInterpolateExtra*10000: 1946ms
benchPinoInterpolateExtra*10000: 638ms
benchPinoUnsafeInterpolateExtra*10000: 527ms
benchPinoExtremeInterpolateExtra*10000: 417ms
benchPinoUnsafeExtremeInterpolateExtra*10000: 303ms
```

@@ -124,2 +126,5 @@

For a fair comparison, [LogLevel](http://npm.im/loglevel) was extended
to include a timestamp.
<a name="cli"></a>

@@ -126,0 +131,0 @@ ## CLI

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc