diff --git a/Jint.Benchmark/GlobalAccessBenchmarks.cs b/Jint.Benchmark/GlobalAccessBenchmarks.cs new file mode 100644 index 000000000..5d17d3b1b --- /dev/null +++ b/Jint.Benchmark/GlobalAccessBenchmarks.cs @@ -0,0 +1,55 @@ +using BenchmarkDotNet.Attributes; +using Jint.Native; + +namespace Jint.Benchmark; + +/// +/// Isolates top-level (global binding) variable access — the stopwatch.js shape where loop +/// counters and state live as global-object properties and every read/write pays a property +/// dictionary lookup. LocalVarLoop is the fixed-slot ceiling/guard for the same operations. +/// +[MemoryDiagnoser] +[HideColumns("Error", "Gen0", "Gen1", "Gen2")] +public class GlobalAccessBenchmarks +{ + private Engine _engine = null!; + private Prepared