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

You need to Close the transpiler when done #1856

Closed
bep opened this issue Jul 11, 2024 · 2 comments · Fixed by #1860
Closed

You need to Close the transpiler when done #1856

bep opened this issue Jul 11, 2024 · 2 comments · Fixed by #1860
Assignees
Labels
backend Backend server changes (GO) bug Something isn't working codebase improvements Various codebase improvements
Milestone

Comments

@bep
Copy link

bep commented Jul 11, 2024

func DartSassTranspiler(log *zap.Logger) *godartsass.Transpiler {

Maybe I'm overlooking something, but open an issue just in case.

Creating a new transpiler spins up a new Dart VM, so not very light weight. The transpiler is thread safe, so ideally you want to start one instance on application startup, use that for everything, then close it on application shutdown.

@KinyaElGrande
Copy link
Contributor

Thank you @bep for pointing this out and for providing an explanation on the why.

I've assigned this issue to myself, and we will be working on fixing it.

@KinyaElGrande KinyaElGrande self-assigned this Jul 11, 2024
@Fajfa Fajfa added this to the 2023.9.8 milestone Jul 11, 2024
@Fajfa Fajfa added bug Something isn't working backend Backend server changes (GO) codebase improvements Various codebase improvements labels Jul 11, 2024
@bep
Copy link
Author

bep commented Jul 11, 2024

one instance on application startup, use that for everything, then close it on application shutdown.

Note that the Close becomes less of an issue if you have one instance, as the child process will die when the main application exits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend server changes (GO) bug Something isn't working codebase improvements Various codebase improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants