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

@lbu/insight

Package Overview
Dependencies
Maintainers
2
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lbu/insight - npm Package Compare versions

Comparing version 0.0.67 to 0.0.68

4

package.json
{
"name": "@lbu/insight",
"version": "0.0.67",
"version": "0.0.68",
"description": "Simple logger in NDJSON format",

@@ -36,3 +36,3 @@ "main": "./index.js",

},
"gitHead": "d42fb37f605b5130899ae4c936f824854927ecf9"
"gitHead": "492675053e2de2236eefb2fd467a66f3862b0b6b"
}
import { createWriteStream } from "fs";
import { bench, logBenchResults, mainFn } from "@lbu/stdlib";
import { bench, mainBenchFn } from "@lbu/cli";
import { newLogger } from "./logger.js";
mainFn(import.meta, async (logger) => {
await runBench();
logBenchResults(logger);
});
mainBenchFn(import.meta);
export async function runBench() {
await bench("logger - strings", (N) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
});
bench("logger - strings", (b) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
});
for (let i = 0; i < N; ++i) {
logger.info("My simple string");
}
for (let i = 0; i < b.N; ++i) {
logger.info("My simple string");
}
stream.end();
stream.end();
});
bench("logger - objects", (b) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
});
await bench("logger - objects", (N) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
for (let i = 0; i < b.N; ++i) {
logger.info({
my: {
simple: "object",
},
});
}
for (let i = 0; i < N; ++i) {
logger.info({
my: {
simple: "object",
},
});
}
stream.end();
});
stream.end();
bench("logger - deep objects", (b) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
});
await bench("logger - deep objects", (N) => {
const stream = createWriteStream("/tmp/logger_bench_lbu.txt", "utf-8");
const logger = newLogger({
pretty: false,
stream,
for (let i = 0; i < b.N; ++i) {
logger.info({
my: {
more: [
{
advanced: {
object: "with",
multiple: "keys",
foo: 5,
},
},
],
},
bar: true,
});
}
for (let i = 0; i < N; ++i) {
logger.info({
my: {
more: [
{
advanced: {
object: "with",
multiple: "keys",
foo: 5,
},
},
],
},
bar: true,
});
}
stream.end();
});
}
stream.end();
});
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