Skip to content

Cached export for incremental - #2400

Merged
laurmaedje merged 8 commits into
typst:mainfrom
Dherse:memoize-export
Oct 17, 2023
Merged

laurmaedje merged 8 commits into
typst:mainfrom
Dherse:memoize-export

Conversation

@Dherse

@Dherse Dherse commented Oct 16, 2023

Copy link
Copy Markdown
Contributor

See #2393

Comment thread crates/typst/src/export/pdf/mod.rs Resolved
Comment thread crates/typst/src/export/render.rs Resolved
Comment thread crates/typst/src/export/svg.rs Resolved

@laurmaedje laurmaedje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The memoize annotations on render and svg functions still need to be removed (but you probably know that).

Comment thread crates/typst-cli/src/compile.rs Outdated
Comment on lines +229 to +232
// If the frame is in the cache, skip it.
if export_cache.is_cached(frame) {
continue;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking that this might be problematic if the file has been deleted in the meantime. Maybe we could check that it is still present with the correct mtime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check that the file exist, but I did not add the modified time check as I feel like this is
a) beyond scope since we'd need to keep track of time which I feel is unnecessary complexity
b) unnecessary, if the person messes up their files, it's on them, and otherwise the file would be overwritten anyway and they would lose their modification

Unless you feel very strongly about this, I'd leave it as is

Comment thread crates/typst-cli/src/compile.rs Resolved
@Dherse

Dherse commented Oct 17, 2023

Copy link
Copy Markdown
Contributor Author

The memoize annotations on render and svg functions still need to be removed (but you probably know that).

Damn, I did it then I messed up my git and didn't migrate it 😠

@laurmaedje
laurmaedje merged commit c0dbb90 into typst:main Oct 17, 2023
@laurmaedje

Copy link
Copy Markdown
Member

Thank you again!

@Dherse
Dherse deleted the memoize-export branch November 27, 2023 11:21
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants