In the blog post series called "Unlocking Performance in your NSO System" we talked about the need to measure performance and to profile the performance in order to identify bottlenecks. We didn't go into any details about how to do this. Last year at the APJ NSO Developer Days, Kristian Larsen presented a deep-dive on that topic.
This session is worth reviewing - I would very much recommend it!