Subsample perf

NOT READY FOR MERGE

Addresses #531 partially. This change resulted in ~10% reduction in runtime. I'm currently unable to profile the cython code for whatever reason, so going about optimization blind. Would be good to squeeze out more.