When is assembly faster than C?

前端 未结 30 2543
挽巷
挽巷 2020-12-02 03:18

One of the stated reasons for knowing assembler is that, on occasion, it can be employed to write code that will be more performant than writing that code in a higher-level

30条回答
  •  日久生厌
    2020-12-02 03:46

    You don't actually know whether your well-written C code is really fast if you haven't looked at the disassembly of what compiler produces. Many times you look at it and see that "well-written" was subjective.

    So it's not necessary to write in assembler to get fastest code ever, but it's certainly worth to know assembler for the very same reason.

提交回复
热议问题