-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Performance improvements - remove garden/spade? #409
Comments
Hey @beders, thanks for the feedback. We've experienced subjective slowness from spade but haven't bothered to look into it so far. I can reproduce what you're seeing, and I agree - it's not nice. Recent changes to spade (dhleong/spade#17) add an optimization that seems like it would fix this. But after upgrading spade, I still see just as many css compiler calls - even on static classes like flex-style. I've done some re-com prototypes using shadow-css. If a quick solution doesn't appear, then think I'll try replacing spade with shadow-css. |
Thanks so much for looking into this. We have a lot of subscriptions in our app and every ms saved when re-rendering that screen helps! |
Yeah, no prob. It's not obvious to me what causes the compile to happen. Maybe spade doesn't properly memoize its behavior because we're rendering in a shadow root? A minimal repro would be really useful. Let me know if you get any insight, otherwise I'll keep poking around periodically. |
Hey @beders, I took out all the spade code used by the subs tab and replaced it with plain css. You can try it out in version 1.9.5. Eventually I think I'll remove spade entirely & try for another clojure-friendly way to organize our styles. |
Sweet! I'll give it a go in one of our largest apps. THANK YOU! |
cool. actually, make sure to use 1.9.6, though. there were some styling bugs in the earlier release. |
Discussed in #408
Originally posted by beders January 2, 2024
Hi there, first of all: thanks for re-frame-10x. Very useful.
That said, team adoption is hindered by performance issues.
With the
subs
tab open, typing into any input field is so slow that it becomes unusable.Even with the
subs
tap not showing, performance is affected quite significantly.Use Chrome's Profiler I think I found one reason for 10xs slowness: Garden CSS.
Here's a snapshot of how much time is actually spent on compiling, expanding and setting CSS.
For some traces, it seems re-com is responsible for a lot of new CSS creation on every render, but it seems 10x is using it directly as well.
So my proposal is to use something like TailwindCSS or another standard static CSS library to avoid the performance hit or maybe figure out why
garden.do_compile
runs for every keystroke (i.e. re-render)The text was updated successfully, but these errors were encountered: