~/talk

Using Dart FFI for Compute-Heavy Tasks

Talkat Fluttercon USA 2025 · 2025-06-25..06-26· [flutter]
links:none on file
slides:none on file

Dart FFI plus native C code is used to speed pixel‑art algorithms (alpha premultiplication, flood fill) in a Flutter plugin built with dart:ffi and the ffi_gen toolchain (CMake/gradle, iOS podspec). Benchmarks show FFI cuts runtime by ~45–63% versus pure Dart, multithreaded C reaches ~80% reduction (~5×), SIMD single‑thread yields ≈10× on iOS, and combined SIMD+threads yields ~20× speedup on iOS and ~13× on Android. Native finalizers and platform/architecture differences require manual memory management and measurement.

AI-written summary · about

  1. 0:00Dart FFI introduction
  2. 1:48Dart FFI use cases
  3. 3:03Dart isolates limits
  4. 6:18Platform channels limits
  5. 7:23Advantages and drawbacks of Dart FFI
  6. 9:27Performance benchmarks
  7. 10:30Setting up FFI
  8. 13:20FFI struct example
  9. 18:43String memory in FFI
  10. 20:50FFI Flutter plugin
  11. 22:38Flutter plugin structure
  12. 25:08Alpha premultiplication gains
  13. 27:58Flatfield algorithm perf
  14. 29:04Multithreading optimization
  15. 30:10SIMD speed boost
  16. 32:37GPU overhead
  17. 33:41Final performance results
  18. 34:03Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.