Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved ToString() performance. #8

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Improved ToString() performance. #8

merged 1 commit into from
Feb 20, 2024

Conversation

jscarle
Copy link
Owner

@jscarle jscarle commented Feb 20, 2024

BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3155/23H2/2023Update/SunValley3)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 8.0.200
  [Host]   : .NET 8.0.2 (8.0.224.6711), X64 RyuJIT AVX2
  .NET 8.0 : .NET 8.0.2 (8.0.224.6711), X64 RyuJIT AVX2
Iterations : 100 000
Method Before After Before After
ResultBaseIndexer 26.06 us 26.33 us - -
ResultBaseHasError 89.81 us 90.63 us - -
ResultOkToString 3,043.52 us 27.78 us 28800370 B -
ResultFailToString 3,232.66 us 74.86 us 28800370 B -
ResultFailWithMessageToString 6,744.95 us 2,837.31 us 69600892 B 24800002 B
ResultTValueOkToString 4,398.32 us 2,556.12 us 47200003 B 15200002 B
ResultTValueFailToString 2,601.94 us 74.39 us 28800002 B -
ResultTValueFailWithMessageToString 6,339.77 us 2,743.11 us 69600003 B 24800002 B
CustomResultOkToString 4,409.29 us 1,880.67 us 43200577 B 8800118 B
CustomResultFailToString 4,529.00 us 2,220.69 us 44000588 B 9600129 B
CustomResultFailWithMessageToString 6,743.94 us 2,797.87 us 71200949 B 26400352 B
ResultOk 18.76 us 18.75 us - -
ResultFail 18.77 us 18.78 us - -
ResultFailWithError 535.57 us 540.72 us 8000000 B 8000000 B
ResultTValueOk 191.08 us 193.06 us 3200000 B 3200000 B
ResultTValueFail 18.75 us 18.73 us - -
ResultTValueFailWithError 549.88 us 551.19 us 8800000 B 8800000 B
ResultOkTValue 191.63 us 190.97 us 3200000 B 3200000 B
ResultFailTValue 18.75 us 18.74 us - -
ResultFailWithErrorTValue 556.70 us 548.32 us 8800000 B 8800000 B
NewError 223.62 us 222.60 us 3200000 B 3200000 B
NewErrorWithString 222.42 us 222.99 us 3200000 B 3200000 B

@jscarle jscarle changed the title Improved performance. Improved ToString() performance. Feb 20, 2024
@jscarle jscarle merged commit 67a7f58 into main Feb 20, 2024
2 checks passed
@jscarle jscarle deleted the feature/improveperf branch February 20, 2024 04:50
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.

1 participant