Skip to content

Dart: build flute directly from dart-lang/flute with Dart 3.14.0-315.3.beta - #333

Open
danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-dart-source-build
Open

danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-dart-source-build

Conversation

@danleh

@danleh danleh commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Part of #277. cc @mkustermann

Build Dart-flute-todomvc-wasm and Dart-flute-complex-wasm from source with Dart SDK 3.14.0-315.3.beta (dart compile wasm -Ddart.vm.product=true -O2 --no-strip-wasm), replacing the prebuilt Dart 3.10.0-37.0.dev binaries from mkustermann/wasm_gc_benchmarks.

Tracking dart-lang/flute directly (712764b):

  • build.sh compiles lib/{complex,todomvc}.dart straight from dart-lang/flute, cutting mkustermann/wasm_gc_benchmarks out of the dependency chain (benchmark.js already vendors the shell task-queue runner).
  • Updating flute from d5adc4d to 712764b picks up b84119f (dart.library.js_util -> dart.library.js_interop, dart-lang/sdk#61550); Dart 3.14 removed dart:js_util on dart2wasm, which otherwise flipped kIsWeb to false and retained ~200 KB of !kIsWeb code.

Toolchain and binaries:

  • Dart 3.14.0-315.3.beta emits standard Wasm exnref (try_table / throw_ref, 0 legacy try/catch instructions) via dart-lang/sdk#54394, whereas 3.13.7 only emits legacy try/catch.
  • Requires JS String Builtins without fallback (Chrome 130, Firefox 134, Safari 26.2) and WebAssembly.JSTag (Chrome 115, Firefox 129, Safari 18.4).
  • Binaries grow by +23 KB net in the --no-strip-wasm name section (complex: 1.36 MB, todomvc: 1.69 MB); both Code sections shrink slightly.

Scores (Linux x64 workstation with jsvu shells, each test alone in a fresh shell, 6 interleaved rounds; change of the mean score, bold = statistically significant at 95% confidence; @kmiller68 may want to check on macOS / arm64):

Test d8 (15.9.60) jsc (325217) SpiderMonkey (160.0b3)
Dart-flute-todomvc-wasm +4.2% +3.7% −1.0%
Dart-flute-complex-wasm +6.1% +7.7% +5.2%
Geomean +5.1% +5.7% +2.0%
First and Average subscores
Test d8 First / Average jsc First / Average SpiderMonkey First / Average
Dart-flute-todomvc-wasm +2.4% / +5.6% +1.0% / +6.3% −3.8% / +2.9%
Dart-flute-complex-wasm +5.3% / +7.5% +5.0% / +9.7% −0.2% / +9.1%

TODO: switch DART_CHANNEL in build.sh from beta to stable (3.14.0) once Dart 3.14 stable ships.

…3.beta

Until now, Dart-flute-todomvc-wasm and Dart-flute-complex-wasm copied
prebuilt binaries from mkustermann/wasm_gc_benchmarks, compiled with Dart
3.10.0-37.0.dev. build.sh now downloads Dart SDK 3.14.0-315.3.beta and
compiles lib/complex.dart and lib/todomvc.dart directly from upstream
dart-lang/flute (712764b), using the same compiler flags as
wasm_gc_benchmarks/compile.sh (`dart compile wasm -Ddart.vm.product=true
-O2 --no-strip-wasm`).

Building directly from dart-lang/flute cuts mkustermann/wasm_gc_benchmarks
out of the dependency chain (benchmark.js already vendors the shell
event-loop runner) and picks up b84119f ("dart.library.js_util ->
dart.library.js_interop for web detection", dart-lang/sdk#61550). Dart
3.14 removed dart:js_util on dart2wasm, so the older flute commit pinned
by wasm_gc_benchmarks (d5adc4d) evaluated `bool.fromEnvironment(
'dart.library.js_util')` to false, silently flipping `kIsWeb` from true to
false across ~40 framework checks and retaining `!kIsWeb` code. The other
7 commits between d5adc4d and 712764b are GitHub Actions workflow bumps.

We use the Dart 3.14 beta SDK rather than 3.13.7 stable because dart2wasm
3.14 emits standard Wasm exception handling (try_table / throw_ref)
unconditionally instead of legacy try / catch instructions
(dart-lang/sdk#54394; 3.13.7 has no flag for try_table). Once Dart 3.14
stable ships, build.sh can switch DART_CHANNEL back to stable.

The generated .mjs loader requires JS String Builtins
(`builtins: ['js-string'], importedStringConstants: ''`, without the old
JS fallback: Chrome 130, Firefox 134, Safari 26.2) and imports
WebAssembly.JSTag (Chrome 115, Firefox 129, Safari 18.4).

Sizes, old -> new (code section in parentheses):
  flute.complex  1,361,004 -> 1,361,608 bytes (656,910 -> 640,126)
  flute.todomvc  1,671,597 -> 1,693,638 bytes (795,168 -> 787,224)

Score change, d8 (15.9.60) / jsc (325217) / SpiderMonkey (160.0b3) (each
test alone in a fresh shell, 6 interleaved rounds):
  Dart-flute-todomvc-wasm  +4.2% / +3.7% / -1.0%
  Dart-flute-complex-wasm  +6.1% / +7.7% / +5.2%

Part of WebKit#277.
@danleh
danleh requested review from eqrion and kmiller68 November 3, 2026 19:07
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit 0ef3101
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/6aea310d432e8f9f5ae451e3
😎 Deploy Preview https://deploy-preview-333--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@danleh danleh added the v3.1 label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant