Click here to Skip to main content
15,895,192 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Eddy Vluggen7-Jun-22 10:35
professionalEddy Vluggen7-Jun-22 10:35 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Member 20992696-Jun-22 1:19
Member 20992696-Jun-22 1:19 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Eddy Vluggen7-Jun-22 10:35
professionalEddy Vluggen7-Jun-22 10:35 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Member 20992697-Jun-22 11:19
Member 20992697-Jun-22 11:19 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Michael Csitkovics5-Jun-22 21:33
Michael Csitkovics5-Jun-22 21:33 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations PinPopular
Richard Deeming5-Jun-22 22:04
mveRichard Deeming5-Jun-22 22:04 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
maze37-Jun-22 0:40
professionalmaze37-Jun-22 0:40 
GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
William Rummler6-Jun-22 6:53
William Rummler6-Jun-22 6:53 
I can reproduce the nature (if not the exact numbers) of these results using BenchmarkDotNet and the same code being benchmarked (i.e. the loop bodies). I added a fifth benchmark for IndexOf with StringComparison.Ordinal.

// * Summary *

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.18363.2274 (1909/November2019Update/19H2)
Intel Core i9-9980HK CPU 2.40GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK=6.0.202
  [Host]             : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT
  .NET 6.0           : .NET 6.0.4 (6.0.422.16404), X64 RyuJIT
  .NET Framework 4.8 : .NET Framework 4.8 (4.8.4510.0), X64 RyuJIT


|         Method |                Job |            Runtime |         Mean |      Error |     StdDev | Ratio | RatioSD |
|--------------- |------------------- |------------------- |-------------:|-----------:|-----------:|------:|--------:|
|        Replace |           .NET 6.0 |           .NET 6.0 |  1,350.99 ns |   7.502 ns |   7.017 ns |  0.33 |    0.01 |
|        Replace | .NET Framework 4.8 | .NET Framework 4.8 |  4,150.69 ns |  80.004 ns |  82.158 ns |  1.00 |    0.00 |
|                |                    |                    |              |            |            |       |         |
|        IndexOf |           .NET 6.0 |           .NET 6.0 | 22,561.81 ns | 435.204 ns | 446.923 ns | 10.44 |    0.34 |
|        IndexOf | .NET Framework 4.8 | .NET Framework 4.8 |  2,189.63 ns |  43.739 ns |  88.354 ns |  1.00 |    0.00 |
|                |                    |                    |              |            |            |       |         |
| IndexOfOrdinal |           .NET 6.0 |           .NET 6.0 |    261.22 ns |   2.760 ns |   2.446 ns |  0.65 |    0.02 |
| IndexOfOrdinal | .NET Framework 4.8 | .NET Framework 4.8 |    403.50 ns |   7.982 ns |   9.502 ns |  1.00 |    0.00 |
|                |                    |                    |              |            |            |       |         |
|      Substring |           .NET 6.0 |           .NET 6.0 |     12.12 ns |   0.310 ns |   0.413 ns |  0.93 |    0.05 |
|      Substring | .NET Framework 4.8 | .NET Framework 4.8 |     13.07 ns |   0.326 ns |   0.563 ns |  1.00 |    0.00 |
|                |                    |                    |              |            |            |       |         |
|         Remove |           .NET 6.0 |           .NET 6.0 |     64.00 ns |   1.208 ns |   1.770 ns |  1.09 |    0.04 |
|         Remove | .NET Framework 4.8 | .NET Framework 4.8 |     59.23 ns |   1.020 ns |   1.253 ns |  1.00 |    0.00 |

GeneralRe: .NET 6.0 is Slower than .NET Framework In Some String Operations Pin
Richard Deeming7-Jun-22 0:56
mveRichard Deeming7-Jun-22 0:56 
GeneralZwölf now at 160% overclocked, running cool and stable. Pin
CodeWraith3-Jun-22 0:22
CodeWraith3-Jun-22 0:22 
GeneralRe: Zwölf now at 160% overclocked, running cool and stable. Pin
Kornfeld Eliyahu Peter5-Jun-22 7:54
professionalKornfeld Eliyahu Peter5-Jun-22 7:54 
GeneralRe: Zwölf now at 160% overclocked, running cool and stable. Pin
CodeWraith6-Jun-22 6:24
CodeWraith6-Jun-22 6:24 
GeneralCCC 2022-06-03 Pin
Peter_in_27802-Jun-22 21:27
professionalPeter_in_27802-Jun-22 21:27 
GeneralRe: CCC 2022-06-03 Pin
OriginalGriff2-Jun-22 21:48
mveOriginalGriff2-Jun-22 21:48 
GeneralRe: CCC 2022-06-03 Pin
Rich Leyshon2-Jun-22 23:10
Rich Leyshon2-Jun-22 23:10 
GeneralRe: CCC 2022-06-03 Pin
DerekT-P2-Jun-22 23:09
professionalDerekT-P2-Jun-22 23:09 
GeneralRe: CCC 2022-06-03 - WINNER! Pin
Peter_in_27802-Jun-22 23:15
professionalPeter_in_27802-Jun-22 23:15 
GeneralSound of the Week Pin
Sander Rossel2-Jun-22 20:50
professionalSander Rossel2-Jun-22 20:50 
GeneralRe: Sound of the Week Pin
Ron Anders3-Jun-22 1:36
Ron Anders3-Jun-22 1:36 
GeneralFrom the Daily Newsletter ... What if We Paid for Bugs? Pin
OriginalGriff2-Jun-22 20:26
mveOriginalGriff2-Jun-22 20:26 
GeneralRe: From the Daily Newsletter ... What if We Paid for Bugs? Pin
Amarnath S2-Jun-22 21:16
professionalAmarnath S2-Jun-22 21:16 
GeneralRe: From the Daily Newsletter ... What if We Paid for Bugs? Pin
raddevus3-Jun-22 3:22
mvaraddevus3-Jun-22 3:22 
GeneralRe: From the Daily Newsletter ... What if We Paid for Bugs? Pin
Kelly Herald3-Jun-22 4:30
Kelly Herald3-Jun-22 4:30 
GeneralRe: From the Daily Newsletter ... What if We Paid for Bugs? Pin
Chris C-B3-Jun-22 0:07
Chris C-B3-Jun-22 0:07 
GeneralRe: From the Daily Newsletter ... What if We Paid for Bugs? Pin
OriginalGriff3-Jun-22 0:23
mveOriginalGriff3-Jun-22 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.