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

Caching loaded template lines to improve performance #345

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pavel-trafimuk
Copy link

Currently, Stencil load and parse template file for each new output file generation,
this improve help to reduce repetitive logic and significantly improve performance (on 30-50%)

@art-divin
Copy link
Contributor

cc @djbe

@tothambrus11
Copy link

tothambrus11 commented Jun 12, 2024

Hello, can somebody review this PR? This change seems to be very useful for our project at Hylo, where we generate thousands of pages for the documentation of the standard library using Stencil.

To my understanding, this would be a breaking change, as the caches require the generator functions to be mutating. In swift there might be a way to opt out of the strict value semantics and make the cache a mutable field that is not part of the object's value, something like the mutable keyword for struct members in C++ that allows the field to be mutated from a const function, thus allowing the introduction of caches with const API.

@pavel-trafimuk
Copy link
Author

@tothambrus11 seems like repo is not maintenaning anymore. this improved already implemented in https://github.com/art-divin/StencilSwiftKit.git and https://github.com/art-divin/StencilSwiftKit.git and finally in Sourcery and it was checked by time.

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.

3 participants