add benchmark script and one non-trivial optimization