Turbocharged: Writing High-Performance C# and .NET Code - Steve Gordon - NDC Oslo 2024

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 15

  • @perdonomai8060
    @perdonomai8060 3 месяца назад +10

    Thanks! Switching from default UTF-16 C# string to UTF-8 will be the best C# performance improvement (including all string libraries)!

  • @KvapuJanjalia
    @KvapuJanjalia Месяц назад +2

    32:55 If I'm not mistaken, that optimization works only for bytes because of unknown endianness of target system where code is going to run. If span element is larger than a byte, a method stub is generated that creates an array instance at runtime and that read-only span points to it. No optimization.

  • @sigma_z
    @sigma_z 3 месяца назад +2

    Awesome presentation. I knew some of these concepts already, but the presentation really drives it home!

  • @ilia__k
    @ilia__k 4 месяца назад +11

    It is almost always possible to avoid while(true) if () break;, replacing it with while (await src.ReadAsync() is {pattern} piece) { handle(piece);}

  • @OscarAgreda
    @OscarAgreda 3 месяца назад +1

    Thank you for making this topic accessible! I appreciate the deep dive into optimizing .NET code, particularly around Span and System.IO.Pipelines. I’m curious about your thoughts on balancing these high-performance techniques with maintaining readability, especially in large teams. Do you think the complexity introduced by these optimizations is justified in most production environments, or should they be reserved for specific high-performance use cases?

    • @Chiramisudo
      @Chiramisudo 2 месяца назад

      Absolutely the latter!! Readability translates to maintainability, and that almost always trumps the performance gains, but that highly depends on the use case. There are certainly times when that performance is critical such as virtual real time processes (in most cases, when real physical devices and hardware are involved): e.g. self driving cars, rocket launch control systems, surgery robots, high speed manufacturing lines, etc.

  • @jianye3259
    @jianye3259 2 месяца назад

    Awesome talk!

  • @NoName-1337
    @NoName-1337 3 месяца назад +2

    Is the code somewhere available? Would be happy, to read slowly through the whole code, to understand everything.
    EDIT: found. it will be mentioned in the end of the first minute of the video.

  • @AlexanderMalyshkin-rg9dh
    @AlexanderMalyshkin-rg9dh 4 месяца назад

    Thank you Steve!

  • @gawiga
    @gawiga 3 месяца назад +2

    It's lovely to see your daughter agreeing with you at the end of the presentation, but wait until she turns 15 to throw it in your face that you should have used RUST from the beginning. 😂
    JK, great presentation, valuable knowledge. Thanks.

    • @Chiramisudo
      @Chiramisudo 2 месяца назад +3

      Bruh! Why is everyone on the Rust bandwagon? It has its uses but is NOT the be-all-end-all, and surely not a replacement for C#, which is an incredible language.

  • @generalyoutubewatching5286
    @generalyoutubewatching5286 3 месяца назад +3

    High performance C# code is an oxymoron. C++ and Rust FTW!

    • @DavidSmith-ef4eh
      @DavidSmith-ef4eh 3 месяца назад +7

      sure, rust is great. if you have lots and lots of time... time to wait for builds. time to learn it. tme to debug the errors. time to understand the complex data annotations..
      but still, I was wondering if he could 've done that csv parser in rust. like proxy pass that part of the app to a rust microservice that does only that..

  • @parko1965
    @parko1965 3 месяца назад +3

    Turbocharged code has got to be written in Java. Thumbs if you agree or disagree