3 ms·
Note that line needs to be omitted from the time measurement, since it's the same for both scripts and is just overhead, I was just measuring the actual mean +
by itamarst 5y ago
Note that line needs to be omitted from the time measurement, since it's the same for both scripts and is just overhead, I was just measuring the actual mean + substraction code.
I reran a few more times, got a bunch of variability, but did get some runs where f64 is just twice as slow, not 10×. Probably my initial run hit swapping. So I will update the article.
That being said, worth noting that this is also quite hardware dependent. Like, I just have 16MB L3 cache, I imagine higher L3 would change ratios a lot.
UPDATE: Oops. Original runs were with NumPy 1.18, this run was with NumPy 1.22. So will rerun again with that.
UPDATE2: NumPy version doesn't matter. So yeah was probably swapping.
UPDATE3: Fixed article should be up in a minute.