Performance tweaks, add benchmarks