diff --git a/Jint.Benchmark/PlainNumericAssignBenchmark.cs b/Jint.Benchmark/PlainNumericAssignBenchmark.cs new file mode 100644 index 000000000..d1f6400f8 --- /dev/null +++ b/Jint.Benchmark/PlainNumericAssignBenchmark.cs @@ -0,0 +1,48 @@ +using BenchmarkDotNet.Attributes; +using Jint.Native; + +namespace Jint.Benchmark; + +/// +/// Function-local plain numeric assignment `lhs = a op b` (NOT compound `+=`, which already has an +/// unboxed slot path). The accumulator `s = s + i` is the micro-loop-sum shape: every iteration's +/// result is an uncached double that otherwise materializes a JsNumber. +/// +[MemoryDiagnoser] +[HideColumns("Error", "StdDev", "Median", "Gen0", "Gen1", "Gen2")] +public class PlainNumericAssignBenchmark +{ + private Engine _engine = null!; + private Prepared