Skip to content

Commit

Permalink
assign values benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
richytong committed Dec 15, 2024
1 parent 61caed1 commit cea7609
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benchmarks/assign.async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cea7609

Please sign in to comment.