resampling optimizations
When working with sub-second resolution, the resampling is often a bottleneck. This is because each new resampling point will look for the last/next valid point and shuffle through a huge amount of data. This kind of search should be cached for higher efficiency (since this effect of high time resolution is not always obvious to the end user).