/ProjectEuler

Fastest solutions of Project Euler problems

Primary LanguageC#

My overly optimized solutions of Project Euler problems, focused on math algorithms and code efficiency

Benchmark

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19042.1165 (20H2/October2020Update)
Intel Core i5-10300H CPU 2.50GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK=5.0.301
  [Host]     : .NET 5.0.7 (5.0.721.25508), X64 RyuJIT
  DefaultJob : .NET 5.0.7 (5.0.721.25508), X64 RyuJIT
Problem Solution Mean (ns) Error (ns) StdDev (ns) Alloc (B) Code (B)
1 C# 7.145 0.0464 0.0411 114
2 C# 2.252 0.0358 0.0299 41
3 C# 2,959.334 6.4148 5.6866 296
4 C# 4,985.330 84.6668 70.7006 288
5 C# 369.928 2.7705 2.5915 67
6 C# 2.711 0.0785 0.0656 40
7 C# 183,786.575 4,719.0404 13,914.1970 105,464 451
8 C# 5,482.294 33.3278 29.5443 125
9 C# 43.824 0.6692 0.6260 199
10 C# 4,586,937.003 79,902.3394 98,127.2485 2,000,024 191
11 C# 3,729.953 45.9832 43.0127 1,113
12 C# 10,231,712.240 41,283.6572 38,616.7585 179
13 C# 2,706.707 23.1532 20.5247 4,896 2,290
14 C# 12,208,562.518 273,230.6109 738,694.8445 8,000,020 239

Legend

  • ns: nanosecond (10-9 second)
  • B : byte

Suggetions and performance improvements are welcome. Submit them here.

References

Contact Information