Buckets:
ktongue/docker_container / .cache /opencode /node_modules /pino /benchmarks /child-creation.bench.js
| const bench = require('fastbench') | |
| const pino = require('../') | |
| const bunyan = require('bunyan') | |
| const bole = require('bole')('bench') | |
| const fs = require('node:fs') | |
| const dest = fs.createWriteStream('/dev/null') | |
| const plogNodeStream = pino(dest) | |
| const plogDest = pino(pino.destination(('/dev/null'))) | |
| delete require.cache[require.resolve('../')] | |
| const plogMinLength = require('../')(pino.destination({ dest: '/dev/null', sync: false, minLength: 4096 })) | |
| const max = 10 | |
| const blog = bunyan.createLogger({ | |
| name: 'myapp', | |
| streams: [{ | |
| level: 'trace', | |
| stream: dest | |
| }] | |
| }) | |
| require('bole').output({ | |
| level: 'info', | |
| stream: dest | |
| }).setFastTime(true) | |
| const run = bench([ | |
| function benchBunyanCreation (cb) { | |
| const child = blog.child({ a: 'property' }) | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| }, | |
| function benchBoleCreation (cb) { | |
| const child = bole('child') | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| }, | |
| function benchPinoCreation (cb) { | |
| const child = plogDest.child({ a: 'property' }) | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| }, | |
| function benchPinoMinLengthCreation (cb) { | |
| const child = plogMinLength.child({ a: 'property' }) | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| }, | |
| function benchPinoNodeStreamCreation (cb) { | |
| const child = plogNodeStream.child({ a: 'property' }) | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| }, | |
| function benchPinoCreationWithOption (cb) { | |
| const child = plogDest.child({ a: 'property' }, { redact: [] }) | |
| for (var i = 0; i < max; i++) { | |
| child.info({ hello: 'world' }) | |
| } | |
| setImmediate(cb) | |
| } | |
| ], 10000) | |
| run(run) | |
Xet Storage Details
- Size:
- 1.91 kB
- Xet hash:
- a155ef4bedb3a7b2ea519a39b9fceca8f298898ac921ea7eafddc39400417c83
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.