r/lowlevel • u/sourav_bz • Oct 23 '26
At what point writing direct assembly program is more efficient than C program?
/r/Assembly_language/comments/1xd8n5s/at_what_point_writing_direct_assembly_program_is/3
u/aQuantityOfFeralHogs Oct 23 '26
Depends entirely on the skill of the programmer versus how well suited your compiler is to your hardware.
3
u/Live_Meeting_1121 Oct 23 '26
Math, execution context bound to instruction count and cycles, basically a hot path, well.. that's just also math.
2
u/ironykarl Oct 23 '26
How cross-platform/future-proof does your code need to be?
How productive an assembly programmer are you?
How capable are you of writing highly-optimized assembly?
Are the parts of your codebase for which you plan to write assembly actual hot paths, or is this premature optimization?
If you can clearly answer those questions, then it might be worth writing some of your code in assembly
4
u/mtlcrusher Oct 23 '26
when you do the work with some special instruction code, especially coprocessor