From e460d62daeee4cef169086ba73dc873da0affb43 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:10:41 -0500 Subject: [PATCH] add Object.keys benchmark comparison --- benchmarks/object/isEmptyRecord.bench.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/benchmarks/object/isEmptyRecord.bench.ts b/benchmarks/object/isEmptyRecord.bench.ts index 46bb1e84..f09b0d2e 100644 --- a/benchmarks/object/isEmptyRecord.bench.ts +++ b/benchmarks/object/isEmptyRecord.bench.ts @@ -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 + }) +})