Skip to content

Add a benchmark for NativeFieldWrapperClass1 and/or tonic::RefCountedDartwrappable #49817

Open
@dnfield

Description

@dnfield

Allocating these objects seems to be much more expensive than allocating a plain Dart object.

See numbers in flutter/engine#35567

@dcharkes said

In the individual call yes, but it's having the bidirectional mapping in the first place that makes it slow I believe.

It's not the individual calls I'm worried about, its the bookkeeping under the hood for the RefCountedDartWrappable.

I might be wrong about that, in which case it would be useful to have a Dart standalone variant in sdk/benchmarks - that would make it easier to figure out what exactly is slow. FFI leaf calls themselves should be really fast. (about 1.5-2.5x slower than a non-inline Dart to Dart call if I remember correctly.)

We should try to drive this down if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.customer-flutter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions