planck

Planck ClojureScript REPL
pepas 2020-02-03T15:40:27.003300Z

Hello! I have written some scripts to build planck in a debian buster chroot, for amd64 and i386. Here are the scripts and the resulting build artifacts: https://github.com/cellularmitosis/builds/tree/master/planck

pepas 2020-02-03T15:41:55.005Z

Interestingly, i386 performance is poor, and may be Debian-specific. It appears WebKit used SSE2 instructions in JavaScriptCore, which are not compatible with older i386 hardware. To work around this, Debian used the CLoop (non-JIT, non-ASM) interpreter in JavaScriptCore to avoid any SSE2 instructions.

pepas 2020-02-03T15:42:17.005500Z

(I should say, startup performance is poor -- I haven't done any throughput benchmarks)

pepas 2020-02-03T15:42:45.005900Z

On an Intel Atom 1.6GHz:

$ time planck -e '(+ 1 1)'
2

real	0m18.440s
user	0m18.913s
sys	0m0.342s

pepas 2020-02-03T15:43:15.006400Z

Clojure startup performance on the same machine for comparison:

$ time clojure -e '(+ 1 1)'
2

real	0m7.902s
user	0m13.091s
sys	0m0.835s

pepas 2020-02-03T15:43:38.006800Z

(note the better use of both cores by Java!)

mfikes 2020-02-03T15:44:25.007400Z

It might be worth setting the JSC_useFTLJIT environment variable to true to see if it speeds things up.

pepas 2020-02-03T15:44:39.007900Z

oh interesting, thanks!

pepas 2020-02-03T15:46:48.008400Z

hmm, looks the same. Debian must have forced CLoop at build-time.

pepas 2020-02-03T15:47:39.008800Z

building my own libjavascriptcore with SSE2 re-enabled would make an interesting comparison!

pepas 2020-02-03T15:48:41.010Z

I've also tried building lumo after discovering that node.js is still available on i386 as an "unofficial" build (lumo appears to use v8's heap snapshotting for faster startup), but I ran into trouble getting the yarn / npm dependencies to work.

pepas 2020-02-03T15:52:53.010300Z

here's the patch which disabled the JIT: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=931052;filename=webkit2gtk-2.24.2-1_2.24.2-2.diff;msg=5