Jaymon / bang

A static site generator with support for RSS feeds, sitemaps, and Google Amp
MIT License
13 stars 0 forks source link

Profiling #58

Open Jaymon opened 2 years ago

Jaymon commented 2 years ago

I'd like to figure out what are the slowest parts of generating the site so I can implement a sensible caching or speedup strategy.

It would be nice to have a profiling class available through config that would not only keep track of certain individual runs, but also add the aggregate of all the similar runs, so I could see how long certain parts of the code take.

The idea would be I could have a log like this:

Rendered html[html]: /PATH/TO/BLOGPOST in N.Mms

And then at the end I could have something like:

Total time spent rendering html: N.Ms
Total time spent copying files: N.Ms

Then I could start making some more informed decisions about what to speed up