3 ms·
One reason to like the "Prime Drag Race" is that it's easier to check whether you just cheated by mistake - because there's a correct answer. Ah, I forgot to ac
by tialaramex 4y ago
One reason to like the "Prime Drag Race" is that it's easier to check whether you just cheated by mistake - because there's a correct answer. Ah, I forgot to actually do the computation, no wonder this new version was so quick!
I'm pretty sure the Java benchmarking code is bogus, and I'm also pretty sure the Rust benchmarking code is bogus, and I have no idea whether the effects cancel out, or are even meaningful. I think if I was presented with this code my question would be "What is the actual problem? What are we actually trying to do, because this isn't anything"
Because this is a wait-free algorithm, the most practical arrangement is to do unlimited produces, and measure the consumers, then separately do unlimited consumption and measure the produces, but even with this, you also want to measure the transformation rate and that isn't done here so far as I can see.
What if I told you the Rust does 10 000 transformations per second, while the Java does only 100? What if vice versa? Suddenly the "performance" takes on a different hue in each case. A single overall number without this information is at least somewhat misleading, even if (which I don't think is assured here) the measurements are both against flat out runs.