Performance optimization

Code profiling