I have a procedure that does a ton of calculations scattered around other procedures. One specific calculation works quickly - less than half a second. The problem is that I need to run these calculations a large number of times, more than 100,000. As a result, everything works together for a very long time, more than 40 minutes.
The question is - how can you find those procedures (part of algorithm) that work out the largest percentage of time? Are there any ready-made practices for this? Any ideas? Any ways to summaraze the work time of functions?