typst-preview icon indicating copy to clipboard operation
typst-preview copied to clipboard

Debounce Input Event

Open Enter-tainer opened this issue 2 years ago • 9 comments

reported by @enivex on discord. typst-preview will use many CPU cores for some reason. We may add a config to debounce input rate.

Enter-tainer avatar Oct 24 '23 03:10 Enter-tainer

Additionally, typst preview seems to block input (or at least there is more lag on input than normal).

IllustratedMan-code avatar Apr 24 '24 15:04 IllustratedMan-code

When typing fast, this also removes the benefit of typst to instantly compile changes. Often times I just watch my key strokes being added one by one inside the preview.

mainrs avatar May 14 '24 12:05 mainrs

When typing fast, this also removes the benefit of typst to instantly compile changes. Often times I just watch my key strokes being added one by one inside the preview.

does your document take a long time to compile?

Enter-tainer avatar May 14 '24 12:05 Enter-tainer

When typing fast, this also removes the benefit of typst to instantly compile changes. Often times I just watch my key strokes being added one by one inside the preview.

does your document take a long time to compile?

Just using the normal typst compile command, no. It's instant. But I usually write my documents with the text file and the preview in split pane. And Everytime I time something, the preview is updated key stroke by key stroke. It lags.

mainrs avatar May 14 '24 12:05 mainrs

When typing fast, this also removes the benefit of typst to instantly compile changes. Often times I just watch my key strokes being added one by one inside the preview.

does your document take a long time to compile?

Just using the normal typst compile command, no. It's instant. But I usually write my documents with the text file and the preview in split pane. And Everytime I time something, the preview is updated key stroke by key stroke. It lags.

can you post a screen record here? i wonder how it looks because i didnt experience such lags

Enter-tainer avatar May 14 '24 12:05 Enter-tainer

Screencast_14.05.2024_15:00:01.webm

Maybe it's package-related. I use polylux for the slides. And tablex, since I hide is bugged in the default table implementation. Therefore, the lines appear on slides even if I hide the table itself.

edit: I think it's tablex. It just is slow when rendering. The normal table is faster, but also kind of lags behind a little bit. In that case a debounce will fix this issue; the compilation will feel faster.

mainrs avatar May 14 '24 13:05 mainrs

thank you for the recording!

about the packages, i remember the builtin table already covered most features of tablex(it is the tablex author himself reimplement the algorithm in rust!). i've also heard that touying is faster to compile than polylux but i havent tried yet.

about the performance: i'm designing a new architechture to improve the performance of the renderer. but recently i'm too busy to move on because of work.

Enter-tainer avatar May 14 '24 13:05 Enter-tainer

about the packages, i remember the builtin table already covered most features of tablex(it is the tablex author himself reimplement the algorithm in rust!).

Technically I do not need any feature that only tablex provides. It is just that, when hiding tables, the builtin table leaves the borders on the PDF page. It's already a known bug. That's why I used tablex, since that package does not exhibit that behavior.

I'll try touying for the next presentation!

mainrs avatar May 14 '24 13:05 mainrs

You can try this in typst-preview v0.11.15 or tinymist v0.11.15: https://github.com/Myriad-Dreamin/tinymist/pull/408 and https://github.com/Myriad-Dreamin/tinymist/pull/412

Myriad-Dreamin avatar Jul 15 '24 02:07 Myriad-Dreamin