• jecxjo@midwest.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    15 hours ago

    P.S. I strongly doubt handwritten assembly is more efficient than modern C compilers.

    As with everything, it all depends.

    When writing super efficient assembly you write towards the destination and not necessarily to fit higher level language constructs. There are often ways to cut corners for aspects not needed, reduction in instructions and loops all based on well designed assembly.

    The problem is you aren’t going to do that for every single CPU instruction because it would take forever and not provide a good ROI. It is far more common to write 99% of your system code in C and then write just the parts that can really benefit from fine tuned assembly. And please note that unless you’re writing for an RTOS or something crazy critical on efficiency, its going to be even less assembly.