-
-
Notifications
You must be signed in to change notification settings - Fork 300
Description
Right now they look like this:
--------- Compilation time statistics --------
Frontend -------------------- Time --- % total
Initialization took: x.xxx ms x.x %
Parsing took: xx.xxx ms xx.x %
Analysis took: xx.xxx ms xx.x %
TOTAL: xxx.xxx ms xx.x %
Backend --------------------- Time --- % total
Ir gen took: xx.xxx ms x.x %
Codegen took: xx.xxx ms xx.x % (x threads)
Linking took: xx.xxx ms x.x %
TOTAL: xxx.xxx ms xx.x %
----------------------------------------------
TOTAL compile time: xxx.xxx ms.
----------------------------------------------
However, upon using $exec for instance, Analysis could go from really small times to almost a second if the script(s) are big and complex. However in a chat on the Discord we forgot about that and I "wasted" time commenting out all macros for nothing, thinking it came from one of them. Which made me think, what if compilation time statistics were (or could be with a flag) more detailed, a simple example to maybe fix the problem we had would be:
--------- Compilation time statistics --------
Frontend -------------------- Time --- % total
Initialization took: x.xxx ms x.x %
Parsing took: xx.xxx ms xx.x %
Analysis took: xxx.xxx ms xx.x %
- Scripts took: xxx.xxx ms xx.x %
- Macros took: xx.xxx ms x.x %
TOTAL: xxx.xxx ms xx.x %
Backend --------------------- Time --- % total
Ir gen took: xx.xxx ms x.x %
Codegen took: xx.xxx ms xx.x % (x threads)
Linking took: xx.xxx ms x.x %
TOTAL: xxx.xxx ms xx.x %
----------------------------------------------
TOTAL compile time: xxx.xxx ms.
----------------------------------------------
This could be applied to all the other fields.
Another solution would be to have options to time things more precisly, so, for example, one that tells you how long each macro took in analysis (not the ones from std and core unless specified, cuz if you do that we're gonna have a big big problem, using a lot of lines), one for each scripts that were run, and more (see what I mean??)
I'm aware this could take a while to implement and make the compiler more complex, but I think considering the options I gave is at least worth the shot