This is why I'm in favor of client-side compilation.
Devs compile to an intermediate language or bytecode of some sort, which then gets compiled on installation / first use / update of the client runtime client-side. Kind of like Java, but instead of being JITted (which causes inconsistent performance) it's compiled and cached.
That way things can be optimized for your specific architecture / computer.
Of course, you can actually do this at the kernel level.