Skip to content

Conversation

@jnyrup
Copy link
Member

@jnyrup jnyrup commented Aug 22, 2021

More optimizations in addition to #1660

#1657

Benchmark results:

#1660

|              Runtime |  N |         Mean |       Error |      StdDev |      Gen 0 |     Gen 1 |  Allocated |
|--------------------- |--- |-------------:|------------:|------------:|-----------:|----------:|-----------:|
|             .NET 5.0 |  1 |     219.9 us |     0.86 us |     0.76 us |    26.6113 |    1.2207 |     164 KB |
| .NET Framework 4.7.2 |  1 |     276.5 us |     1.54 us |     1.36 us |    28.8086 |    0.9766 |     178 KB |
|             .NET 5.0 | 10 |  11,887.3 us |    98.84 us |    92.45 us |  1546.8750 |  140.6250 |   9,535 KB |
| .NET Framework 4.7.2 | 10 |  16,133.7 us |    31.25 us |    27.71 us |  1875.0000 |  156.2500 |  11,552 KB |
|             .NET 5.0 | 50 | 302,525.7 us | 1,266.79 us | 1,184.95 us | 38000.0000 | 2500.0000 | 235,048 KB |
| .NET Framework 4.7.2 | 50 | 420,015.7 us | 1,012.14 us |   946.76 us | 47000.0000 | 2000.0000 | 289,532 KB |

2c02139

|              Runtime |  N |          Mean |        Error |       StdDev |      Gen 0 |     Gen 1 |  Allocated |
|--------------------- |--- |--------------:|-------------:|-------------:|-----------:|----------:|-----------:|
|             .NET 5.0 |  1 |      77.50 us |     1.030 us |     0.964 us |    17.7002 |    0.4883 |     109 KB |
| .NET Framework 4.7.2 |  1 |     100.02 us |     0.818 us |     0.765 us |    18.3105 |    0.4883 |     113 KB |
|             .NET 5.0 | 10 |  11,473.69 us |    74.099 us |    61.876 us |  1484.3750 |  140.6250 |   9,134 KB |
| .NET Framework 4.7.2 | 10 |  15,942.24 us |    57.994 us |    54.248 us |  1812.5000 |  156.2500 |  11,149 KB |
|             .NET 5.0 | 50 | 299,437.31 us | 2,796.149 us | 2,615.519 us | 36000.0000 | 2000.0000 | 225,708 KB |
| .NET Framework 4.7.2 | 50 | 410,502.04 us | 1,209.430 us | 1,072.128 us | 45000.0000 | 2000.0000 | 279,940 KB |

0ee102a

|              Runtime |  N |          Mean |        Error |       StdDev |      Gen 0 |     Gen 1 |  Allocated |
|--------------------- |--- |--------------:|-------------:|-------------:|-----------:|----------:|-----------:|
|             .NET 5.0 |  1 |      77.50 us |     0.486 us |     0.431 us |    17.7002 |    0.4883 |     109 KB |
| .NET Framework 4.7.2 |  1 |     100.43 us |     1.231 us |     1.151 us |    18.3105 |    0.4883 |     113 KB |
|             .NET 5.0 | 10 |  11,295.65 us |    50.847 us |    42.460 us |  1484.3750 |  140.6250 |   9,107 KB |
| .NET Framework 4.7.2 | 10 |  15,628.73 us |   140.952 us |   131.847 us |  1796.8750 |  156.2500 |  11,121 KB |
|             .NET 5.0 | 50 | 290,311.10 us | 2,931.077 us | 2,741.731 us | 36500.0000 | 3000.0000 | 224,950 KB |
| .NET Framework 4.7.2 | 50 | 402,446.02 us | 1,302.002 us | 1,154.191 us | 45000.0000 | 2000.0000 | 279,188 KB |

@jnyrup jnyrup requested a review from dennisdoomen August 22, 2021 15:42
Copy link
Member

@dennisdoomen dennisdoomen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which was the biggest change? The regex tweak?

@jnyrup
Copy link
Member Author

jnyrup commented Aug 22, 2021

Unsure what you're asking for. Are you looking for a summary of the data from the benchmarks I included?

@dennisdoomen
Copy link
Member

No, I was just wondering what was causing the biggest improvement.

@jnyrup
Copy link
Member Author

jnyrup commented Aug 22, 2021

In terms of cpu the two commits are rather equal whereas for memory the type check of Subject gives the most benefits.

@jnyrup jnyrup merged commit 8440f44 into fluentassertions:master Aug 22, 2021
@jnyrup jnyrup deleted the StringAssertions_optimize branch September 5, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants