From c63c12b276618790ac44aad55fd332d056578d45 Mon Sep 17 00:00:00 2001 From: Marais Rossouw Date: Thu, 23 May 2024 15:13:25 +1000 Subject: [PATCH] :construction: WIP --- src/bench.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/bench.ts diff --git a/src/bench.ts b/src/bench.ts new file mode 100644 index 0000000..9246dd6 --- /dev/null +++ b/src/bench.ts @@ -0,0 +1,18 @@ +import * as v4 from 'npm:diary@^0.4'; +import * as v5 from './mod.ts'; + +v4.enable('*'); + +let log = v4.diary('test', (e) => { + JSON.stringify(e); +}); +Deno.bench('v4', () => { + log.info('hello', { name: 'world' }); +}); + +let logv5 = v5.diary((e) => { + JSON.stringify(e); +}); +Deno.bench('v5', () => { + logv5('info', 'hello {name}', { name: 'world' }); +});