This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/PowerUp.Core/Decompilation/JITExtensions.cs b/src/PowerUp.Core/Decompilation/JITExtensions.cs | |
index 88b3397..0f18362 100644 | |
--- a/src/PowerUp.Core/Decompilation/JITExtensions.cs | |
+++ b/src/PowerUp.Core/Decompilation/JITExtensions.cs | |
@@ -5,23 +5,18 @@ using System.Runtime.CompilerServices; | |
using System.Text; | |
using PowerUp.Core.Console; | |
using System.Linq; | |
+using System.Runtime.InteropServices; | |
using PowerUp.Core.Decompilation.Attributes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int? A(int? x, int? y) { | |
int? sum = 0; | |
for(int i = 0; i < 1000; i++) | |
sum += x + y; | |
return sum.Value; | |
} | |
public int? B(int? x, int? y) { | |
int? sum = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Running; | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
using System.Linq; | |
using System.Collections.Generic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bench92 | |
{ | |
public int[] _x = null; | |
[GlobalSetup] | |
public void Setup() | |
{ | |
_x = new int[10000]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bench92 | |
{ | |
public int[] _x = null; | |
[GlobalSetup] | |
public void Setup() | |
{ | |
_x = new int[10000]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bench92 | |
{ | |
[Benchmark(Baseline = true)] | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
[Arguments(0)] | |
public int A(int x) | |
{ | |
try { _ = 1; } catch { } | |
for (int i = 0; i < 10000; i++) { | |
x++; x++; x++; x++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bench92 | |
{ | |
[Benchmark(Baseline = true)] | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
[Arguments(0)] | |
public int A(int x) | |
{ | |
try { _ = 1; } catch { } | |
for (int i = 0; i < 1000; i++) | |
x++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bench73 | |
{ | |
public int[] _a = new int[100_000]; | |
[Benchmark(Baseline = true)] | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
public void A() | |
{ | |
for (int i = 0; i < 10000; i++) | |
_a[1] = 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[IterationCount(10)] | |
[InvocationCount(100_000_000)] | |
public class Bench22 | |
{ | |
Random rnd = new Random(); | |
private int x; | |
public int X | |
{ | |
get { return rnd.Next(1, 5); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DisassemblyDiagnoser(maxDepth: 4)] | |
public class Bench5 | |
{ | |
public int[] array = null; | |
public int size = 500_000; | |
public int x = 10; | |
public int y = 10; | |
[GlobalSetup] | |
public void Setup() |
NewerOlder