Skip to content

MonoModEmitReference

wuke32767 edited this page Mar 16, 2025 · 7 revisions

All methods are ilhooked.

Standard and EmitIntReference returns int, StandardO and EmitObjReference returns int[].

Standard*: ILHook do nothing.

Emit*Reference: ILHook replace the return value with a EmitReference.


BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.200
  [Host]     : .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2
  DefaultJob : .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2


Method Mean Error StdDev
Standard 26.79 ns 0.010 ns 0.009 ns
StandardO 26.45 ns 0.026 ns 0.023 ns
EmitIntReference 37.59 ns 0.047 ns 0.042 ns
EmitObjReference 34.98 ns 0.052 ns 0.049 ns

// * Detailed results *

MonoModEmitReference.Standard: DefaultJob

Runtime = .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2; GC = Concurrent Workstation

Mean = 26.790 ns, StdErr = 0.002 ns (0.01%), N = 13, StdDev = 0.009 ns

Min = 26.777 ns, Q1 = 26.787 ns, Median = 26.788 ns, Q3 = 26.792 ns, Max = 26.808 ns

IQR = 0.005 ns, LowerFence = 26.779 ns, UpperFence = 26.800 ns

ConfidenceInterval = [26.780 ns; 26.801 ns] (CI 99.9%), Margin = 0.010 ns (0.04% of Mean)

Skewness = 0.45, Kurtosis = 2.23, MValue = 2

-------------------- Histogram --------------------

[26.772 ns ; 26.813 ns) | @@@@@@@@@@@@@


MonoModEmitReference.StandardO: DefaultJob

Runtime = .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2; GC = Concurrent Workstation

Mean = 26.445 ns, StdErr = 0.006 ns (0.02%), N = 14, StdDev = 0.023 ns

Min = 26.394 ns, Q1 = 26.433 ns, Median = 26.444 ns, Q3 = 26.457 ns, Max = 26.491 ns

IQR = 0.024 ns, LowerFence = 26.397 ns, UpperFence = 26.492 ns

ConfidenceInterval = [26.419 ns; 26.472 ns] (CI 99.9%), Margin = 0.026 ns (0.10% of Mean)

Skewness = -0.1, Kurtosis = 2.92, MValue = 2

-------------------- Histogram --------------------

[26.381 ns ; 26.503 ns) | @@@@@@@@@@@@@@


MonoModEmitReference.EmitIntReference: DefaultJob

Runtime = .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2; GC = Concurrent Workstation

Mean = 37.595 ns, StdErr = 0.011 ns (0.03%), N = 14, StdDev = 0.042 ns

Min = 37.550 ns, Q1 = 37.564 ns, Median = 37.585 ns, Q3 = 37.613 ns, Max = 37.700 ns

IQR = 0.049 ns, LowerFence = 37.490 ns, UpperFence = 37.687 ns

ConfidenceInterval = [37.548 ns; 37.642 ns] (CI 99.9%), Margin = 0.047 ns (0.12% of Mean)

Skewness = 1.12, Kurtosis = 3.35, MValue = 2

-------------------- Histogram --------------------

[37.528 ns ; 37.723 ns) | @@@@@@@@@@@@@@


MonoModEmitReference.EmitObjReference: DefaultJob

Runtime = .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2; GC = Concurrent Workstation

Mean = 34.977 ns, StdErr = 0.013 ns (0.04%), N = 15, StdDev = 0.049 ns

Min = 34.885 ns, Q1 = 34.933 ns, Median = 34.994 ns, Q3 = 35.012 ns, Max = 35.063 ns

IQR = 0.079 ns, LowerFence = 34.815 ns, UpperFence = 35.130 ns

ConfidenceInterval = [34.925 ns; 35.029 ns] (CI 99.9%), Margin = 0.052 ns (0.15% of Mean)

Skewness = -0.23, Kurtosis = 1.88, MValue = 2

-------------------- Histogram --------------------

[34.859 ns ; 35.089 ns) | @@@@@@@@@@@@@@@


// * Summary *

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)

AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores

.NET SDK 9.0.200

[Host] : .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2

DefaultJob : .NET 9.0.2 (9.0.225.6610), X64 RyuJIT AVX2

| Method | Mean | Error | StdDev |

|----------------- |---------:|---------:|---------:|

| Standard | 26.79 ns | 0.010 ns | 0.009 ns |

| StandardO | 26.45 ns | 0.026 ns | 0.023 ns |

| EmitIntReference | 37.59 ns | 0.047 ns | 0.042 ns |

| EmitObjReference | 34.98 ns | 0.052 ns | 0.049 ns |

// * Hints *

Outliers

MonoModEmitReference.Standard: Default -> 2 outliers were removed (28.50 ns, 28.53 ns)

MonoModEmitReference.StandardO: Default -> 1 outlier was removed (30.29 ns)

MonoModEmitReference.EmitIntReference: Default -> 1 outlier was removed (39.41 ns)

// * Legends *

Mean : Arithmetic mean of all measurements

Error : Half of 99.9% confidence interval

StdDev : Standard deviation of all measurements

1 ns : 1 Nanosecond (0.000000001 sec)

Clone this wiki locally