ways to assess performance:
- dart developer timeline events
- Linux perf utility for Dart standalone (especially single-threaded/single-isolate performance) to see time spent in both Dart and native code
some simple tips and tricks for making some FFI patterns faster:
- avoid copying data, keep it in native memory if you can
- if you have many small calls, use leaf calls
- if you want to avoid copying data from Dart to native, and the call is short, use a leaf call and the .address.
- if you use a helper isolate, use send-and-exit (not really FFI specific, but more common to use with FFI).