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

CSScript.CachProbing #398

Open
jclaborde opened this issue Dec 12, 2024 · 1 comment
Open

CSScript.CachProbing #398

jclaborde opened this issue Dec 12, 2024 · 1 comment

Comments

@jclaborde
Copy link

with the old version CSScriptLibrary.v3.5 i load file with this line CSScriptLibrary.CSScript.Load(csScript,dllFile, debugBuild: false);
If the file in csScript don't have change since the last compilation, the dllFile was load without recompilation( very fast)

I now user the last version 4.8.21
I try to use the options CSScript.IsOutOfDateAlgorithm = CSScript.CachProbing.Advanced (or Simplified) and there is no effect on the recompilation (dependending on changes or not on the scritps files)
Is it a way to compile my file only if there is a change since the last loading?
Thanks
Jc laborde

@oleg-shilo
Copy link
Owner

In the new (.NET-Core-based) CS-Script the API for caching has changed. Now it is set per evaluator instance. The rest is pretty much the same:

dynamic script = CSScript.Evaluator
                         .With(eval => eval.IsCachingEnabled = true)
                         .LoadMethod(@"public (int, int) func()
                                       {
                                           return (0,5);
                                       }");
(int, int) result = script.func();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants