Open
Description
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.