<div dir="ltr"><div style="user-select: auto;">Hi All,</div><div style="user-select: auto;"><br style="user-select: auto;"></div><div style="user-select: auto;">I am reaching out for help because I hit a bit of a road block using Graal&#39;s Polyglot API in regards to performance. I am developing a service that will execute user defined scripts (written in JS) using the Polyglot API and execution times are proving to be much slower than I had hoped for. </div><div style="user-select: auto;">I posted on the GraalJS Github page all the details, and while I got some great feedback there, I still have not found/received a solution to the problem yet.</div><div style="user-select: auto;"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_graalvm_graaljs_issues_57&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=Ec3OB3aijYH6YyUWCz-T5lrkyAz4P3YEYHiu6H41tOA&s=K_051DOogNt2_sCwUHpKBRLK0knLZLa2b4T74mOmbNE&e=" target="_blank" style="user-select: auto;">https://github.com/graalvm/graaljs/issues/57</a><br style="user-select: auto;"></div><div style="user-select: auto;"><br style="user-select: auto;"></div><div style="user-select: auto;">I have learned through experimentation and got confirmation of this from the GraalJS guys that the Context object learns code as it evaluates it and gets better (performance wise) at executing it over time. What I am trying to understand at this point is if there is a way to serialise a Context object, so that it retains the knowledge about the code that it has executed up until the time of serialisation, and hence its performance. This would then allow me, by deserialising the context object,  to execute code with the most performant context without having to keep the instance alive in memory the whole time.</div><div style="user-select: auto;"><br style="user-select: auto;"></div><div style="user-select: auto;">Do you know if this is achievable in any way?</div><div style="user-select: auto;">Thanks in advance for your help.</div><div style="user-select: auto;"><br style="user-select: auto;"></div><div style="user-select: auto;">Cheers</div><div style="user-select: auto;">Edoardo. </div></div>