|
|
|
|
|
by mraleph
4220 days ago
|
|
> I have the following methods (via macro defs) in my "native extension": Can't you just expose the data you are reading as an external typed data array to the Dart code? That would remove any need for those methods. > - Dart developers does not like annotation I like annotations! > - Dart VM executes custom "native (which in fact are very fast)" methods very slow This concern is very valid: it is true that transition between Dart code and native methods is too heavyweight and as a developer you have no way to fix it yourself. We had plans to fix it eventually - but they never been very high on the list of things. Did you file a bug for the slowness of your native extension? |
|
I work on integrating into Dart ecosysem "foreign functions interface" (ffi).
External typed data is not suitable in many cases:
- Does not provide physical storage address to use code (binary interop requires that)
- I don't need it because it heavyweight if use it with C pointers and references
- It has limit in size (specified in Dart VM on max array length)
- I need malloc and typed data does not help here in any way
- I access data (by physical address) allocated externally
>> Did you file a bug for the slowness of your native extension?
This is useless. A long time ago we already did not come to a consensus.