jacobobryant / platypub

A publishing platform built with Biff
MIT License
65 stars 13 forks source link

Make site rendering faster #32

Closed jacobobryant closed 1 year ago

jacobobryant commented 2 years ago

This function takes about 10 seconds on my machine: https://github.com/jacobobryant/platypub/blob/3f8b390a61bbad2f651283e232112b9df39684ea/src/com/platypub/feat/sites.clj#L86 Need to profile first. I'm pretty sure tailwind takes up the most time. Maybe there's some way to cache it. Or pass in an opt so render-site only passes the --minify option to tailwind when you're actually publishing the site.

Theoretically it seems like it would be pretty fast to get all the tokens tailwind might recognize via regex and, and then only generate a new css file if there's actually been a change. Sounds like a pain to implement though, unless there's an easily accessible set of regexes laying around somewhere.

The almost gratuitous npm install probably takes up a couple seconds too.

jacobobryant commented 2 years ago

This may be solved in the process of doing #56 and #21

jacobobryant commented 1 year ago

It's been pretty fast after packaging the generated css file with the theme instead of running tailwind on every render.