Created
August 11, 2015 14:03
-
-
Save moritzuehling/b40921f4eeac744027f6 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Runtime.CompilerServices; | |
namespace LeckerBrot | |
{ | |
public class RowCalulator | |
{ | |
public void Calc() { | |
for (int i = 0; i < 100000000; i++) { | |
double zr = 0, zi = 0; | |
for (int j = 0; j < 10; j++) { | |
CalculatePoint (12, 12, ref zr, ref zi); | |
} | |
} | |
} | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public void CalculatePoint(double cr, double ci, ref double zr, ref double zi) { | |
var zr_old = zr; | |
zr = (zr * zr - zi * zi) + cr; | |
zi = 2 * (zi * zr_old) + ci; | |
} | |
} | |
} |
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
using System; | |
using System.Runtime.CompilerServices; | |
namespace LeckerBrot | |
{ | |
public class RowCalulator | |
{ | |
public void Calc() { | |
for (int i = 0; i < 100000000; i++) { | |
double zr = 0, zi = 0; | |
for (int j = 0; j < 10; j++) { | |
double cr = 12, ci = 12; | |
var zr_old = zr; | |
zr = (zr * zr - zi * zi) + cr; | |
zi = 2 * (zi * zr_old) + ci; | |
} | |
} | |
} | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
public void CalculatePoint(double cr, double ci, ref double zr, ref double zi) { | |
} | |
} | |
} |
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
using System; | |
using System.Runtime.CompilerServices; | |
namespace LeckerBrot | |
{ | |
public class RowCalulator | |
{ | |
public void Calc() { | |
for (int i = 0; i < 100000000; i++) { | |
double zr = 0, zi = 0; | |
for (int j = 0; j < 10; j++) { | |
CalculatePoint (12, 12, ref zr, ref zi); | |
} | |
} | |
} | |
[MethodImpl(MethodImplOptions.NoInlining)] | |
public void CalculatePoint(double cr, double ci, ref double zr, ref double zi) { | |
var zr_old = zr; | |
zr = (zr * zr - zi * zi) + cr; | |
zi = 2 * (zi * zr_old) + ci; | |
} | |
} | |
} |
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
using System; | |
using System.Diagnostics; | |
namespace LeckerBrot | |
{ | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
Stopwatch watch = new Stopwatch (); | |
RowCalulator calc = new RowCalulator (); | |
watch.Start (); | |
calc.Calc (); | |
watch.Stop (); | |
Console.WriteLine (watch.ElapsedTicks); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mono Version
Results
Profile is always release
Configuration
Other System Information
Processor: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz