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

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น •

  • @perdonomai8060
    @perdonomai8060 5 หลายเดือนก่อน +15

    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 หลายเดือนก่อน +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 4 หลายเดือนก่อน +2

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

  • @ilia__k
    @ilia__k 5 หลายเดือนก่อน +11

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

  • @NoName-1337
    @NoName-1337 4 หลายเดือนก่อน +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.

  • @jianye3259
    @jianye3259 3 หลายเดือนก่อน

    Awesome talk!

  • @OscarAgreda
    @OscarAgreda 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน

      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.

  • @AlexanderMalyshkin-rg9dh
    @AlexanderMalyshkin-rg9dh 5 หลายเดือนก่อน

    Thank you Steve!

  • @gawiga
    @gawiga 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +3

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

    • @DavidSmith-ef4eh
      @DavidSmith-ef4eh 4 หลายเดือนก่อน +8

      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 4 หลายเดือนก่อน +3

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