-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Move sdk/lib/html/dartium/nativewrappers.dart ? #32311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please do not delete this file, it is in use. It can be probably moved somewhere else though. |
Shiva with Dartium gone the file sdk/lib/html/dartium/nativewrappers.dart is only needed by the VM. I would like to move this file to sdk/lib/vmservice is that okay with you? |
|
That's fine with me. Siva is that okay for you? |
Or could the contents of nativewrappers be added to dart:_internal and the nativewrappers.dart file then be eliminated? Since its no longer shared with Dartium. |
I am fine with that but also check with the analyzer folks (@bwilkerson) because I think they look for this file when analyzing sources |
Feel free to rename the issue to "move" instead of delete.
…On Mon, Feb 26, 2018 at 8:30 AM, Siva ***@***.***> wrote:
I am fine with that but also check with the analyzer folks ***@***.***
<https://github.com/bwilkerson>) because I think they look for this file
when analyzing sources
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32311 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCiq0QXfR8yZzo6dm8YcGc8-n9GStNks5tYtwdgaJpZM4SSfHW>
.
|
We are customizing Flutter for our project, which needs some Dart-C-interop Is it safe to use |
I am not sure I understand the question. Can you clarify?
If you need Dart-C interop you should use |
There is a blocker issue on
|
What do you mean by "non-accepted"? You can't use it for some reason? Is it for code size or other reasons? Then we should figure a way to make FFI work for you. /cc @dcharkes |
Code size is the main concern |
@Sunbreak how much larger does you IPA become if you change the option to Non-Global Symbols? |
The flutter module adds about 21MB to the archive of our hybrid project. |
@Sunbreak Thanks! That's a valuable thing to know, helps to put this into perspective and prioritise. Just to confirm: 7MB is the change in size of the exported IPA, with thinning applied? If that's the case this is indeed quite a lot and we should certainly look for solutions. |
The build(with provision file) on CI is quite slow. I archive locally and get Exported IPAs may be thinner. 5MB gap is a reasonable guess We've made a lot effort to strip flutter module and another 2MB will hit the upper limit of module size |
We use flutter/tonic for Dart-C-interop and find it quite slower than dartAdd: 0.17 ms
int add(int a, int b) {
return a + b;
}
void dartAdd(int count) {
print('dart start ${DateTime.now()}');
for (var i = 0; i < count; i++) {
add(1, 2);
}
print('dart end ${DateTime.now()}');
} ffiNativeAdd: 0.17 ms
final DynamicLibrary nativeAddLib = Platform.isAndroid
? DynamicLibrary.open("libnative_add.so")
: DynamicLibrary.process();
final int Function(int x, int y) nativeAdd = nativeAddLib
.lookup<NativeFunction<Int32 Function(Int32, Int32)>>("native_add")
.asFunction();
#include <stdint.h>
extern "C" __attribute__((visibility("default"))) __attribute__((used))
int32_t native_add(int32_t x, int32_t y) {
return x + y;
} tonicNativeAdd: 1.18 ms
int nativeAdd(int a, int b) native 'TonicBinding_NativeAdd';
int32_t TonicBinding::NativeAdd(int32_t a, int32_t b) {
return a + b;
} Is |
Well, that's the whole idea of why we developed FFI in the first place. It's a faster, more AOT friendly way to bind Dart to native code.
It is ready - there are multiple projects that use it already, there are few missing pieces still (e.g. struct by value) which we are finishing right now, after that we are planning to declare "1.0" release of Dart FFI. We also would like to address #43582 so that you could use it without penalising your code size. |
sdk/sdk/lib/html/dartium/nativewrappers.dart
Line 1 in ea6991a
Thoughts @terrylucas ? @jacob314 ?
The text was updated successfully, but these errors were encountered: