Skip to content

Commit

Permalink
add Object.keys benchmark comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Feb 5, 2025
1 parent 983e63f commit e460d62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions benchmarks/object/isEmptyRecord.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ describe('isEmptyRecord', () => {
isEmptyRecord({ a: 1, b: 2, c: 3 })
})
})

describe('Object.keys comparison', () => {
bench('empty object', () => {
Object.keys({}).length === 0
})

bench('object with one property', () => {
Object.keys({ a: 1 }).length === 0
})
})

0 comments on commit e460d62

Please sign in to comment.