Replies: 1 comment
-
Good question... I made a ticket to write a docs page on So, the goal of that LRU cache is to prevent
Now, in terms of when the Lines 20 to 28 in b6d4582 reactive . This is so that you keep getting the now value updated - the trigger times themselves would stay the same from call to call until you trigger the slide. Because the trigger state is a reactive , any change causes the widget it is on to repaint, which calls SlideWidget.render , which ends up calling Slide.render , which calls the Slide.content function. So that's at least 60 calls per second, plus anything else that makes the widget repaint/refresh.
So: you get a cache hit as long as:
Without the LRU cache, we'd instead call Hope that answers your question! I'd definitely rate it as a hack on top of the underlying trigger system right now - I'm hoping I'll figure out a better, less-hacky way to integrate executable examples in #179 . |
Beta Was this translation helpful? Give feedback.
-
Alternate title: "When a Slide has a callable 'content' kwarg, when is that content called?"
While looking through the
pytest-its-whats-for-testing
source for some inspiration, I stumbled across this unexpected use of LRU cache. After puzzling on it for a while now, I'm really stumped as to why it's there.Shouldn't each trigger have a unique, monotonic timestamp? When would we expect a cache hit here?
I might be bumping into a limitation of not understanding what's going on in textual with its concept of renderables
Beta Was this translation helpful? Give feedback.
All reactions