Skip to content

[doc] Add docs for FFI performance trouble shooting and improvements #2738

@dcharkes

Description

@dcharkes

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions