PgBiel / typst-tablex

More powerful and customizable tables in Typst
Apache License 2.0
373 stars 13 forks source link

Really long tables are resource intensive. #5

Open taylorh140 opened 1 year ago

taylorh140 commented 1 year ago

I'm making an absurdly long table with repeating headers: In regular table its like 200 pages i havent been able to type set it yet in typst.

image

When it does build it does seem to be right though. Im using: typst git f08ae95b9d8be5165f9c8cac4c755d0510c3a18a

im not sure it will complete compilation as its been 40 minutes, and its using a bunch of ram.

PgBiel commented 1 year ago

Do those resource usage issues occur with the same table being typeset using just #table (instead of #tablex)?

PgBiel commented 1 year ago

Also, please provide a minimum reproducible example for me to debug the issue. Thanks for the report!

PgBiel commented 1 year ago

Alright, this seems to be a good example:

#import "./tablex.typ": tablex

#tablex(
    columns: 3,
    ..range(0, 200 * 200).map(i => [aaaaaaaa])
)

Placing 200 tables of 200 cells each seems to take much less time to compile (but still eats RAM):

#range(0, 200).map(_ => tablex(
    columns: 3,
    ..range(0, 200).map(i => [aaaaaaaa])
)).join()

Native tables don't have this problem (likely because they don't use locate and etc.). I believe the rework spoken about in #2, if done using exclusively layout (from typst v0.2.0), would likely help reduce this issue by a lot.

taylorh140 commented 1 year ago

Well, sorry for not getting back to you sooner. It really only affects the tablex. I would have gotten to the MWE but it looks like you already got it. Ill have to take a look at #2 .

PgBiel commented 1 year ago

Oh, please don't worry @taylorh140! I'm glad you brought this to my attention. I probably won't be able to fix this now, but, in the coming weeks, I should hopefully be able to get to it when I do this rework on the table's drawing process.