> I find fast.com massively overestimates my speeds.
I find fast.com more accurate than most, going by the throughput I see to/from other resources, particularly for upstream rates (which some, including Cloudflair, seem to significantly under-measure). Of course this may vary depending on line type (FTTC, “up to 67Mbit down n& 17 up”, generally seeing more like 50/12) and location (due to differences in local network conditions and peering between you & the speedtest) to I'm not surprised to hear you see the results quite different to those I experience.
> if you hide the tab running their speedtest you get even higher speeds
I suspect this is due to your browser throttling CPU use and timer granularity for background or occluded tabs⁰ reducing the accuracy of the readings, if the code isn't working to mitigate the effect of these throttles on the calculations.
Interestingly, if you hide the tab running their speedtest you get even higher speeds.