-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic CSS caching to oranda #551
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a solid approach, but i'll give liv a chance to look at it since she was planning to do this next week
Misc bonus I didn't realize while initially developing: This means that long running
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is a good start for sure
This PR adds a very naive caching implementation when fetching the pre-built CSS. This applies only to assets that would be fetched over the network.
For larger workspace projects, the blocking requests can add a significant amount of time:
Before:
After:
In the future, it may be desirable to cache this at the filesystem level (in
.cache/
or similar), or to handle this in a more common way, such as in a consistent manner managed byaxoasset
.Debatable design decisions:
Vec::new()
is const andHashMap::new()
isn'tO(n)
vsO(1)
lookup, particularly compared to a network requestexpect()
on Mutex poisoning rather than bubbling up the error:Feel free to close this if y'all aren't interested, but 3-4 second iteration times for me is nicer than 12-15 second iteration times.