(use-modules (charting) (charting draw) (ice-9 match)) ;; https://www.youtube.com/watch?v=TwuIRcpeUWE (define code-bytes 23891164) (define (seconds->ns/byte secs) (/ (* secs 1e9) code-bytes)) (make-performance-chart "Code generation latency for Zen Garden WebAssembly demo" (map (match-lambda ((title . compilers) (cons title (map (match-lambda ((compiler . times) (cons compiler (map seconds->ns/byte times)))) compilers)))) '(("JavaScriptCore" ("concurrent tiering" 1.034 1.01 1.01 0.983 1.013 0.938 1.015 0.99 0.982 0.959 0.984 0.998 0.99 0.984 0.992 0.973 0.97 0.983 0.983 0.939) ("baseline interpreter" ;; --useConcurrentGC=false --useConcurrentJIT=false --useWasmLLInt=true --useBBQJIT=false --useOMGJIT=false 1.258 1.234 1.234 1.243 1.224 1.281 1.228 1.242 1.241 1.236 1.223 1.223 1.227 1.232 1.233 1.244 1.228 1.234 1.227 1.223) ("baseline compiler" ;; --useConcurrentGC=false --useConcurrentJIT=false --useWasmLLInt=false --useBBQJIT=true --useOMGJIT=false 14.412 14.554 14.203 14.234 14.307 14.959 14.17 14.218 14.179 14.052 14.301 14.088 14.483 14.364 14.109 14.479 14.164 14.056 14.749 14.674) ;; Can't test optimizing compiler because OMG needs WasmLLInt or BBQ ) ("V8" ("concurrent tiering" 0.546 0.531 0.486 0.511 0.514 0.518 0.527 0.523 0.52 0.497 0.497 0.506 0.491 0.499 0.484 0.485 0.498 0.487 0.499 0.541) ("baseline compiler" ;; --single-threaded --liftoff --no-wasm-tier-up 1.742 1.709 1.727 1.719 1.713 1.707 1.71 1.708 1.711 1.74 1.769 1.771 1.718 1.712 1.718 1.712 1.717 1.707 1.711 1.712) ("optimizing compiler" ;; --single-threaded --no-liftoff 24.137 24.397 23.748 23.585 23.738 23.55 24.521 23.848 24.115 24.384 24.301 24.059 23.494 23.669 23.491 24.001 24.28 23.518 24.418 24.06) ) ("SpiderMonkey" ("concurrent tiering" 0.479 0.475 0.469 0.465 0.441 0.461 0.452 0.473 0.47 0.474 0.465 0.479 0.469 0.46 0.474 0.458 0.467 0.435 0.432 0.465) ("baseline compiler" ;; --no-threads --wasm-compiler=baseline 1.009 0.925 0.923 0.927 0.925 0.937 0.923 0.923 0.924 0.924 0.923 0.922 0.922 0.923 0.924 0.923 0.923 0.922 0.922 0.923) ("optimizing compiler" ;; --no-threads --wasm-compiler=ion 11.001 11.107 11.473 12.117 11.354 11.177 10.994 10.987 11.357 11.41 10.995 10.992 11.191 11.213 11.007 11.433 10.98 11.002 11.326 11.138)))) #:log-y-base 2 #:y-axis-label "nanoseconds / wasm code byte; shorter is better" #:box-width 40 #:write-to-png "zen-garden-latency.png") (define ipc-data '(("JavaScriptCore" ("baseline interpreter" ;; --useConcurrentGC=false --useConcurrentJIT=false --useWasmLLInt=true --useBBQJIT=false --useOMGJIT=false (6228409844 . 3692831293)) ("baseline compiler" ;; --useConcurrentGC=false --useConcurrentJIT=false --useWasmLLInt=false --useBBQJIT=true --useOMGJIT=false (71981332481 . 42155489093)) ;; Can't test optimizing compiler because OMG needs WasmLLInt or BBQ ) ("V8" ("baseline compiler" ;; --single-threaded --liftoff --no-wasm-tier-up (9626361858 . 5223673699) ) ("optimizing compiler" ;; --single-threaded --no-liftoff (107548132972 . 70440348592)) ) ("SpiderMonkey" ("baseline compiler" ;; --no-threads --wasm-compiler=baseline (5293288934 . 2821281052)) ("optimizing compiler" ;; --no-threads --wasm-compiler=ion (50671349551 . 32967659029))))) (reset-colors!) (define (insts->insts/byte insts) (/ insts 1.0 code-bytes)) (make-performance-chart "Compiler instructions per code byte: Zen Garden WebAssembly demo" (map (match-lambda ((title . compilers) (cons title (map (match-lambda ((compiler (insts . cycles) ...) (cons compiler (map insts->insts/byte insts)))) compilers)))) ipc-data) #:log-y-base 2 #:y-axis-label "instructions / wasm code byte" #:box-width 40 #:write-to-png "zen-garden-compiler-instructions-per-byte.png") (reset-colors!) (make-performance-chart "Compiler instructions per cycle: Zen Garden WebAssembly demo" (map (match-lambda ((title . compilers) (cons title (map (match-lambda ((compiler (insts . cycles) ...) (cons compiler (map (lambda (i c) (/ i 1.0 c)) insts cycles)))) compilers)))) ipc-data) #:y-axis-label "instructions per cycle spent in compiler" #:box-width 40 #:write-to-png "zen-garden-compiler-instructions-per-cycle.png")