Suppose I have a script that's timing out, and I want to see where it's spending most of its time. I know I can benchmark any given line of code, but my understanding is that if I do:
Benchmark.measure { test = "a"*1_000_000 }
That it will measure the time it takes every time that line is reached. But I want to know which parts of my program are causing the slowdown overall, being called multiple times. Is there an easy way to group lines together across the course of the program for Benchmarking?
Update: Realizing now the proper term here is profiling rather than benchmarking.