From cea76098645694456b217944c8bdf4fa174efd3d Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 15 Dec 2024 11:00:15 -0800 Subject: [PATCH] assign values benchmarks --- benchmarks/assign.async.js | 8 ++++++++ benchmarks/assign.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/benchmarks/assign.async.js b/benchmarks/assign.async.js index 01842424..9c81121a 100644 --- a/benchmarks/assign.async.js +++ b/benchmarks/assign.async.js @@ -3,6 +3,14 @@ const assign = require('../assign') const suite = new TimeInLoopSuite({ async: true, loopCount: 1e5 }) +suite.add('rubico assign async values', async () => { + await assign({}, { + a: Promise.resolve(1), + b: Promise.resolve(2), + c: Promise.resolve(3), + }) +}) + suite.add('rubico assign', async () => { await assign({}, { a: async () => 1, diff --git a/benchmarks/assign.js b/benchmarks/assign.js index ee8487b0..ae3a4e02 100644 --- a/benchmarks/assign.js +++ b/benchmarks/assign.js @@ -3,6 +3,14 @@ const assign = require('../assign') const suite = new TimeInLoopSuite() +suite.add('rubico assign values', () => { + assign({}, { + a: 1, + b: 2, + c: 3, + }) +}) + suite.add('rubico assign', () => { assign({}, { a: () => 1,