DWScript status update

DWScript SVN repository has been fleshed out during the last days:

  • there are now several samples, an half-decent collection of unit tests, and the “classes” library module which offers basic containers.
  • code should be compatible with from Delphi 2009 to Delphi XE.
  • some more optimizations got enabled.
  • timeouts for script execution are now specified in milliseconds (used to be seconds).

A 7zip snapshot of the SVN is available here and will serve as preview.

On a side note, I re-ran the informal performance tests: they are now running about twice faster than during my previous post. Also, one of the demos is used as a floating-point benchmark, and renders a Mandelbrot fractal (once with Delphi, once with DWS). It’ll serve as reference for future progress and help detect performance regressions.

SamplingProfiler v1.7.5

A new version has been released which adds support for the new Delphi XE paths, you can download it here.

Note that there is still a pseudo-random issue of unknown origin under Windows 7, where the utility may or may not be able to gather profiling information. If that happens, close the application and launch it again. The issue doesn’t happen with Windows OSes before 7.

Things on the radar for DWS

Or a roadmap of sorts. The basic idea is to maintain forward compatibility for the “external” aspects: the language and the components. At the same time, the internals of DWS will be subject to evolution, incremental Darwinian evolution, rather than a straight break into some next-gen architecture.

(more…)

Informal DelphiWebScript performance tests

I’ve made some informal performance tests on DWS vs PascalScript vs Delphi.

The PascalScript version was downloaded yesterday, though when compiling, I got many warnings hinting its code hasn’t been fully upgraded to Unicode and D2009, so maybe it wasn’t the latest version? I’m not a user of PascalScript, so if anyone want to chime in, feel free!

The script I used for testing was something like

var s, i: Integer;
for i:=1 to 1000000 do s:=s+i;

with only minimal syntax adaptations to get it running and compiling in the various environments. For PascalScript, I tweaked the “sample1” project to run the script, so maybe there were some optimization options not active? If so, let me know!
The result timings on my machine were (including compilation and execution, except for Delphi):

Delphi: <1 msec (using 32bit integers), 1.5 msec (using 64bit integers)
DWS2 revival: 150 60 msec in D2009 (using 64bit integers)
DWS2 vanilla: 420 msec in D7 (using 32bit integers)
PascalScript: 1860 msec in D2009, 1490 msec in D7 (using 32bit integers)

Note that in DWS2 revival, integers are 64bit integers (more on that and other changes later).

I then redid the test using a double precision float for the “s” variable: Delphi goes up to 15 msec, DWS2 revival increases to 180 95 ms (vs 670 ms for vanilla), PascalScript results were unchanged.

Last test consisted in moving the “s:=s+i” to a function, to measure the call overhead. Delphi laughed at me and stayed with roughly the same figures, PascalScript went up to 3000 msec, and DWS2 revival took a hit to 1000 msec. Function calls are indeed a DWS area with still some simplifications and optimizations potential 😉

As for the re-release time-frame, I’m waiting to hear from the original maintainers, as well as removing a few dependencies to make it into a standalone library (currently the compiler itself is standalone, but the DWS library equivalents of system & sysutils units aren’t).

edit 2010-09-01: following a round of cleanup and optimizations, figures for DWS revival are now 60 and 95 msec for 64bit integers and floats respectively.