scalameta / scalagen

WIP - Scalameta powered code generation
Apache License 2.0
40 stars 5 forks source link

Add a best effort internal profiler #33

Open DavidDudson opened 6 years ago

DavidDudson commented 6 years ago

Accuracy is not important here. just subtracting nanotime should be good enough. We don't care about IO blocking or wall vs cpu time etc.

I would like to time the following:

This is related to, but not the same as #5

This will be targeted at the user, not the library.

For example, It would be nice to get an output such as

Scalagen Timings.
Total: 5s
Traversal: 3s (200 files/s)
Generation: 1.5s 
 - org.simulacrum.typeclass: 900ms
 - org.scalameta.ast: 100ms
 - org.freesio.free: 500ms
FQN: 0.5s

These would be outputted to SBT.

This would allow the Author's to optimize easily. It would also allow us to get an idea of how scalagen affects various projects.

DavidDudson commented 6 years ago

Blocked by #36