From: Jérôme Benoit Date: Mon, 24 Oct 2022 20:22:22 +0000 (+0200) Subject: Do not benchmark deprecated uuid generator X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ce26b710fea3b0e48d26fc7565f393cb211b585e;p=benchmarks-js.git Do not benchmark deprecated uuid generator Signed-off-by: Jérôme Benoit --- diff --git a/.prettierignore b/.prettierignore index 879d126..567bc86 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1 @@ -benchmark/results/ \ No newline at end of file +benchmark/results/ diff --git a/package.json b/package.json index 801e41e..f402a27 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,7 @@ "dependencies": { "benny": "^3.7.1", "microtime": "^3.1.1", - "uuid": "^9.0.0", - "uuidv4": "^6.2.13" + "uuid": "^9.0.0" }, "devDependencies": { "eslint": "^8.26.0", diff --git a/promise-handling.js b/promise-handling.js index 002be6d..b07b33d 100644 --- a/promise-handling.js +++ b/promise-handling.js @@ -13,7 +13,7 @@ function promise () { * */ async function asyncFunction () { - await promise() + return await promise() } Benchmark.suite( diff --git a/uuid-generator.js b/uuid-generator.js index 11cf3c1..0bed70c 100644 --- a/uuid-generator.js +++ b/uuid-generator.js @@ -1,7 +1,6 @@ const Benchmark = require('benny') const crypto = require('crypto') -const { v4: uuidv4 } = require('uuid') -const { uuid } = require('uuidv4') +const { v4: uuid } = require('uuid') Benchmark.suite( 'UUIDv4 generator', @@ -9,9 +8,6 @@ Benchmark.suite( crypto.randomUUID() }), Benchmark.add('uuid', () => { - uuidv4() - }), - Benchmark.add('uuidv4', () => { uuid() }), Benchmark.cycle(),