Replies: 3 comments 1 reply
-
Have you looked at using the Worker API? |
Beta Was this translation helpful? Give feedback.
-
I have replaced |
Beta Was this translation helpful? Give feedback.
-
Updating Static with megabytes of data will certainly prompt a lot of work. We're talking hundreds of pages of text being reflowed each update. Using a Log will updating a line at a time. But you can still freeze the UI if you write many lines in an event handler. The solution probably involves workers, but I couldn't say for certain without seeing your code. Since you are using a lot of concurrency, you may be blocking without realizing it. And that may not be obvious from profiling. |
Beta Was this translation helpful? Give feedback.
-
While playing around with what textual can do I have built a very simple repository updater, that keeps my source code clones up to date and shows me what's new in a few projects (like e.g. textual).
Works fine so far, it starts up, runs various
git pull
in background-processes and shows the output in aStatic
. If I see something that interests me, I can then have a simplegit diff
run in the background and callStatic.update
to now render the diff. The problem I have is thatStatic.update
lags immensely once we get to text sizes in the megabytes, which for a git diff of a medium sized project can happen rather quickly. That lag completely blocks the UI for several seconds, asrich.segment.split_and_crop_lines
seems to take very long, at least from a cursory investigation via flamegraph.So what I'm asking is: what is the best approach to such a large-size update in the textual ecosystem if
Static.update
is not it?Beta Was this translation helpful? Give feedback.
All reactions