This file contains 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
// M1 is 108% faster than M2. | |
public static unsafe void TestMethod1() | |
{ | |
float* samples = stackalloc float[12500]; | |
for (var i = 0; i < 4000; i++) | |
{ | |
for (var ii = 0; ii < 12500; ii++) | |
{ |
This file contains 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
var leave = false; | |
while (someCondition && !leave) | |
{ | |
System.Threading.Thread.Sleep(500); | |
Application.Current.Dispatcher.Invoke(new Action(() => | |
{ | |
if (someOtherCondition) | |
{ |
This file contains 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
namespace C_Sharp_Benchmarker | |
{ | |
class Program | |
{ | |
private static int testIterations = 10000000; | |
public static void Main(string[] args) | |
{ | |
var t1 = Test1(); | |
var t2 = Test2(); |
NewerOlder