graaljs icon indicating copy to clipboard operation
graaljs copied to clipboard

eval of a Source object takes twice the time in a native image

Open nsoubelet opened this issue 5 months ago • 0 comments

Hi team,

Some context of my current env:

  • Graal Version => graalvm-community-openjdk-22+36.1
  • org.graalvm.polyglot:polyglot => 24.0.2
  • org.graalvm.polyglot:js-community => 24.0.2
  • Relevant Build args: --gc=serial; -march=compatibility

The "issue" is really simple, when evaluating a somehow complex Source, like this one , in a regular Java app (no native) it takes, let's say, 1000ms, but when evaluating the same Source in a native image, it takes exactly twice the time, that is, 2000ms.

By adding stopwatches to the entire operation (Context Creation > Bindings > Eval), I confirmed that 99.9% of the total time is consumed by the eval, meaning that problem is entirely isolated, so there is nothing else adding noise to the measurement.

Is it a known thing or am I misconfiguring something from my side?

nsoubelet avatar Sep 04 '24 11:09 nsoubelet