optimize a bit and measure perf