Open kimo-k opened 10 months ago
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 (https://github.com/dhleong/spade/pull/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.
I finally had time for a bit of testing. I've tested 1.9.8 which shows some improvements.
The trace here shows a few keystrokes in an input field in our app (with over 281 subs) with the Subs tab open. A key stroke event recomputes 34 subs (78 are ignored). I guess the underlying issue here is: Don't have 281 subs ;)
Thanks for the great improvement.
Looks like re-com.box
is spending some time in initialization (clojure map destructuring is expensive) and merging.
Digging a bit deeper, there's some spade code that contributes 100ms to this trace:
Not sure where to go from here.
Turning on Highlight updates when components render
in the react dev tools shows a lot of repaints in the re-frame-10x window (I can't tell how many of those 281 subs are repainting), so maybe there's a way to reduce updates.
For now this is much faster than before (I can't compare the numbers directly since I migrated to a different machine in the meantime).
Discussed in https://github.com/day8/re-frame-10x/discussions/408