Implements #614

I've performed the changes outlined in the issue description. Benchmarks show that the performance degradation is ~0.7%