Optimizing C++ code after Spectre/Meltdown kernel patches

78 Views Asked by At

So I recently read an article on The Register about the impact on pure computational stuff due to microcode updates for Spectre/Meltdown mitigation.

The linked paper specifies that this is for unoptimized code, which seems to imply that there are optimizations one can do that are specific to dealing with the mitigation patches. Neither the Register article nor research paper details what those optimization might be. However, it is only implied. Searching for "Spectre/Meltdown optimization" of course only returns results on how those vulnerabilities attack processor branch-predicting optimizations.

So my question is, are there specific things I can do as a programmer to optimize code on a patched system?

1

There are 1 best solutions below

0
On

Make fewer system calls; Spectre mitigation makes them more expensive.

e.g. it may become worth it to cache results instead of redoing a system call.