4 ms·
It absolutely is, which is why the benchmarks posted should not be taken seriously. Some environments don't have a scheduler or a "user-space", and so this imp
by Kranar 5y ago
It absolutely is, which is why the benchmarks posted should not be taken seriously.
Some environments don't have a scheduler or a "user-space", and so this implementation can suffice, but the problem with this post is that all of the testing and benchmarking are done in user-space, and hence the metrics are not very meaningful.
- tialaramex 5y agoIt's a micro-benchmark. "Everybody" can write a faster lock that wins on a micro-benchmark they built, and I guess if your goal is to feel smug then you're all done. If you actually have a performance problem, you need to benchmark the entire system that isn't performing as well as you'd like, then try to distil a small element you can optimise, micro-benchmark that, improve it using your micro-benchmark to measure progress, then apply the improvement to the large system, and then finally benchmark the larger system again to discover if the changes paid off. This will be much more time-consuming, but if you don't do this work then you're probably just masturbating. The larger system might be Twitter, or Hacker News, or Binding of Isaac, or a SatNav, but the performance of those larger things is what matters, if you micro-optimise your spinlock to be 5% better but now Hacker News falls over with half as many simultaneous users, you made it worse not better.