Improved benchmarking code