Closed ziotom78 closed 8 months ago
I have implemented this because I am going to optimize the code used to compute the pointings, and I needed a simple way to monitor the time spent in different parts of the code.
Please test it and tell me if it looks ok: I would like to merge this in a few days, if no objections arise.
Hi @ziotom78, I played at bit with the code. It looks fine to me. It will be quite useful in the future. Thanks!
This PR implements a simple time profiler and a high-level interface for the methods in the class
Simulation
.Here is an example that shows how to use its low-level interface:
The high-level interface is automatically called by methods in the
Simulation
class. When a simulation ends andSimulation.flush()
is called, a set of JSON files is created in the output directory. These files can be opened in the webapp https://www.speedscope.app/. This is how Speedscope looks if you open the fileprofile.json
created by the script above:Simulation
class