‹ BackHN Continuity

Thread

Performance Improvements in .NET 11

349 points · 112 comments · soheilpro

  1. AlexErrant · · focus · HN ↗
    Dumb Q: should a non-systems-language dev know/read assembly?

        ; Arm64
        --- .NET 10
        +++ .NET 11
        @@ -13,8 +13,6 @@
                    ble     G_M000_IG04
    
        G_M000_IG03:
        -            cmp     w1, w2
        -            bhs     G_M000_IG05
                    str     wzr, [x0, w1, UXTW #2]
    
        G_M000_IG04:
        @@ -25,4 +23,4 @@
                    bl      CORINFO_HELP_RNGCHKFAIL
                    brk     #0
    
        -; Total bytes of code 68
        +; Total bytes of code 60
    
    I know C#/F# decently well, but is there any reason to actually pull out the ol textbooks and learn wtf the above is saying?
    1. jlarocco · · focus · HN ↗
      Kinda. I use the `disassemble` function in Common Lisp quite a bit, and I can't work backwards to explain what a function is doing based on the disassembly.

      BUT what I can do is see which functions are being inlined, which values are in memory versus in registers, see if things are being boxed and unboxed a lot, see if SIMD is being used, etc.

      And more importantly I can compare two versions of a function to see which one looks better by those criteria. It's not perfect, but IME it works really well for guiding optimization.

      I should add that I read the book "Assembly Language: step-by-step" by Jeff Duntemann, and wrote a Tic-Tac-Toe game in assembly ages ago, so that helps a bit to understand the syntax.

      (And technically that's a patch file :-)

      1. bjoli · · focus · HN ↗
        What I wish more languages did was what the guile optimizer does. There is a source->source optimizer which does inlining, DCE, CSE and partial evaluation.

        That is very handy, especially when writing macros. I only have to look at assembly when I want to know about optimizations that are not visible in the source->source optimizer.

        If I ever want to know if something is reified (which I never do) I can always look at the ASM.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.