3 ms·
One challenge is that the table cutoff size in a microbenchmark will be higher than in an application that has other cache pressure. So for example, you may ha
by nullc 3y ago
One challenge is that the table cutoff size in a microbenchmark will be higher than in an application that has other cache pressure.
So for example, you may have a bit of code that is rarely very hot unless you're being DOS attacked. If you are it's performance is limiting for the system, so very important.
Otherwise it just runs intermittently. A large table may win in a microbenchmark or under the dos load, but trash the application performance outside of attacks due to flushing out the cache relative to a slower implementation with a smaller table or no table.
It's often difficult to measure the overall application performance difference between changes to components (as effects from alignment may dominate). And even if you do know that you have a situation like I described the correct choice isn't always obvious.
- fluoridation 3y agoDon't do a microbenchmark, test the entire application under expected usage with and without the LUT. If it's supposed to tolerate a DoS, test that as well. A LUT is a drop-in replacement; there's no need to rely on some synthetic benchmark that may not be representative when you can test on the real thing.
- Brian_K_White 3y agoYou can even have the code detect a usage/abusage pattern and switch implementations on the fly.