-
Notifications
You must be signed in to change notification settings - Fork 7
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
Incompatibilities with package precompilation #43
Comments
I've tried (so hard) to eliminate
What's worse, you can't know how many I also really want to implement my package using generated function. If you have any idea to do this, please let me know... |
Passing around the calling I'd honestly try avoiding generated functions, they've got limitations around what you should be putting in them. Just using a macro-based approach to get the code generated at the right time should be viable for this kind of thing. Obviously it's all up to you in the end though :) |
The last part that I mentioned
is kind of separate to the issue of which module to |
I got it. That was exactly what I was looking for. I'm not sure how long does it take to apply this idea, but I'll try. |
I changed the implementation of Template (especially
I'll release this change as v1.0.0 (because, with this change, we no longer waste memory even when rendering multiple times on a server, etc.), so try it after it's released. |
Thank you for writing and maintaining this package @MommaWatasu.
Due to the usage of
eval
in the code belowOteraEngine.jl/src/template.jl
Lines 171 to 173 in 2322f13
The definition of
MWE
iswith the following versions used:
If the precompilation workload is removed then the following example can be run and is illustrative of the problem:
Each time a defined template is called an entirely new function object is defined within the
OteraEngine
module.Ideally the fix for this is evaluating just once per template into the calling module, rather than on each render into
OteraEngine
itself. Whether that's a doable change to the package implementation isn't something I can tell.The text was updated successfully, but these errors were encountered: