First phase of dynamic arrays refactoring completed

The first phase of dynamic arrays refactoring mentioned previously is now complete, with dedicated implementations in place for all the base types. A single interface (IScriptDynArray) is now the only common ground.

  • Memory usage is reduced to 1/3 on average, performance is improved up to 2x (without JIT)
  • Array indexes have thus been bumped from Integer to NativeInt, as arrays of more than 2 billions elements have become more practical

The current state has been frozen in Release snapshot DWScript v21.3.11 on the GitHub mirror.

(more…)

Refactoring DWScript dynamic arrays

After reaching initial stages of the x86-64 JIT, work on a long overdue enhancement of the DWScript engine has started: refactoring how dynamic arrays are implemented.

One of the goals when the 32bit JIT was introduced was to edge out the Delphi 32bits compiler, which was not too complicated as Delphi was using the FPU, so merely using SSE2 at the time was enough. But the Delphi 64bits compiler makes good use of SSE2, so the only way to edge it out would be to leverage AVX2 and vectorisation.

(more…)