performance tests and tweaks