Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Slowness when the document has a large table of contents #240

Open
psads-git opened this issue Feb 1, 2024 · 5 comments
Open

Slowness when the document has a large table of contents #240

psads-git opened this issue Feb 1, 2024 · 5 comments

Comments

@psads-git
Copy link

This is just to report that preview gets notoriously slower when there is a large table of contents (generated by outline).

The reported slowness is not unacceptable, but maybe something can be done to improve the situation. Thanks!

@Enter-tainer
Copy link
Owner

can you show an example typ file that triggers the problem? this will help us diagnose the problem faster

@psads-git
Copy link
Author

psads-git commented Feb 1, 2024

Thanks, @Enter-tainer, for your reply.

The following code shows the issue:

#set heading(level:1, numbering: "1.")

#outline()

#for i in range(1, 100) {
  let s = [Section ] + [ ] + str(i)
  heading(s)
  lorem(120)
  for j in range(1, 20) {
    let s = [Subsection] + [ ] + str(j)
    heading(level: 2, s)
    lorem(250)
  }
}

@Myriad-Dreamin
Copy link
Collaborator

The slowness is already observed in the masterproef thesis. It is caused by a typst outline element creating thousands of circles (the dots in the outline) in the page, and each circle results in many groups (<g/>) and bezier paths (<path/>). perhaps we don't have good solution. Rasterizing these dots is a way but very difficult.

@Enter-tainer
Copy link
Owner

to verify(and workaround) this, you may try redefine how outline is displayed -- and removing these dots. it should be faster

@psads-git
Copy link
Author

Yes, @Enter-tainer, I confirm that using

#outline(fill: none)

makes it faster!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants