aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-11 16:14:53 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-11 16:14:53 -0800
commit27e40b0836f183430e5ac7128d9046c561c07e73 (patch)
treea4dd9b600c0fb49f881169a5996a42085ee86993 /bench
parentb57f51fda2b8255ff986887c9b975db96277400a (diff)
downloadbun-27e40b0836f183430e5ac7128d9046c561c07e73.tar.gz
bun-27e40b0836f183430e5ac7128d9046c561c07e73.tar.zst
bun-27e40b0836f183430e5ac7128d9046c561c07e73.zip
Update WebKit
cc @cirospaciari you will need to re-download the precompiled WebKit build from the releases page https://github.com/oven-sh/WebKit/releases/tag/dec11 because there is one small WebKit API change. LMK if you have any trouble with that
Diffstat (limited to 'bench')
-rw-r--r--bench/snippets/object-values.mjs47
1 files changed, 47 insertions, 0 deletions
diff --git a/bench/snippets/object-values.mjs b/bench/snippets/object-values.mjs
new file mode 100644
index 000000000..5902d3a23
--- /dev/null
+++ b/bench/snippets/object-values.mjs
@@ -0,0 +1,47 @@
+const obj = {
+ a: 1,
+ b: 2,
+ c: 3,
+ d: 4,
+ e: 5,
+ f: 6,
+ g: 7,
+ h: 8,
+ i: 9,
+ j: 10,
+ k: 11,
+ l: 12,
+ m: 13,
+ n: 14,
+ o: 15,
+ p: 16,
+ q: 17,
+ r: 18,
+ s: 19,
+ t: 20,
+ u: 21,
+ v: 22,
+ w: 23,
+};
+
+import { bench, group, run } from "mitata";
+
+var val = 0;
+bench("Object.values(literal)", () => {
+ obj.a = val++;
+ Object.values(obj);
+});
+const objWithMethods = {
+ ...obj,
+ toString() {},
+ valueOf() {},
+ [Symbol.iterator]() {},
+ [Symbol.toPrimitive]() {},
+};
+var val = 0;
+bench("Object.values(literal with methods)", () => {
+ objWithMethods.a = val++;
+ Object.values(objWithMethods);
+});
+
+await run();