Skip to content

Remove gensym usage for better precompilation caching #1266

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

Open
ChrisRackauckas opened this issue May 13, 2025 · 3 comments
Open

Remove gensym usage for better precompilation caching #1266

ChrisRackauckas opened this issue May 13, 2025 · 3 comments

Comments

@ChrisRackauckas
Copy link
Member

These should just be hashes instead.

@isaacsas
Copy link
Member

@ChrisRackauckas not sure what you are suggesting by using hashes. Can you point me to an example?

@ChrisRackauckas
Copy link
Member Author

using Symbolics
@variables x y
hash(x+y)

So osys = ODESystem(eqs, iv; name = hash(eqs)) , make_rs_expr(:($(hash(expr))), expr) would make it so you have the same equation every time, which means if you make a reaction system with the same equations (and same names of variables) then you'd get exactly the same function and be able to reuse the precompiled cache.

It might only work with precompilation with v1.11 because of JuliaLang/julia#52119, I'm not sure about some of the edges here, but at least it is something the compiler relies on.

@isaacsas
Copy link
Member

OK, this sounds like something to look at for Catalyst 16 once MTK 10 is released.

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

No branches or pull requests

2 participants