Hacker News new | past | comments | ask | show | jobs | submit login

> But even once you know (definitively) that the code could be faster, it's often really tough to convince a given compiler to generate the code that you want. And coming up with a single construct that works well for multiple compilers and remains readable is often impossible.

I once struggled with GCC to output the code I wanted (I wanted indirect unconditional jumps) and I finally found that the way to tell GCC (and perhaps other compilers) to do this is to use goto's (of the "considered harmful variety") with function pointers. And it was, IIRC, twice as fast, and didn't involve any assembler.

I think the deeper problem with compilers is they target code and algorithms that are already known. If you compile anything it hasn't seen before, you're really throwing it a curveball.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: