Performance test for binary search tree and refactoring