Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

William Rummler

@William Rummler
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • I hate recent C# versions!
    W William Rummler

    Richard Deeming wrote:

    That would give you a CS0106 compiler error. :)

    Not on a struct. :rose: Some C# features are intended mostly or solely to try to help produce more readable code. But some (like the readonly modifier on structs and their members) exist because they allow increased performance and/or compiler-enforced constraints against unintended usages of objects and their members. All that said, I have definitely seen (fine, I'll admit it, sometimes even written :~) code that goes overboard with the more concision-focused syntax that OP mentions. Doesn't help that VS is constantly underlining anything that can be converted to a ternary or expression-bodied member. X| Don't get me wrong, these two things have their place, and the corresponding auto-fixes should be right there in the editor context menu, but their possibility shouldn't trigger the code underlining... :java:

    The Lounge csharp question

  • .NET 6.0 is Slower than .NET Framework In Some String Operations
    W William Rummler

    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
    The Lounge csharp dotnet com performance announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups