From 8c7f71e2ac12f4681447ebb77fe3af237150e541 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 11 Jun 2024 21:17:34 +0900 Subject: [PATCH] Add a benchmark for property access using dynamic member lookup --- .../TestSuites/Sources/BenchmarkTests/main.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift b/IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift index 2803f0137..4c8af0887 100644 --- a/IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift +++ b/IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift @@ -83,3 +83,11 @@ objectHeap.testSuite("Increment and decrement RC") { n in _ = global.objectHeapDummy } } + +let propertyAccess = Benchmark("Property access") + +propertyAccess.testSuite("Dynamic member lookup") { n in + for _ in 0 ..< n { + _ = global.jsNumber + } +}