Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants