Dart ffi: first call on iOS device extremely slow
- Dominant language
- Dart
- Stars
- 275
- Forks
- 144
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 47
Description
I am trying to run a GO project ([kagome](https://github.com/ikawaha/kagome)), compiled using CGO to a binary, in Flutter ([here you can find the really bad bindings](https://github.com/CaptainDario/kagome_dart)). This is working very well for Android, MacOS and Windows. But somehow, it takes a very long time (something like 10 min) to run a method (`initTokenizer`) on iPads (most probably iPhones too). This method initialises a global variable. The weird thing is, it does not take any significant amount of time on any other Platform (Windows, MacOS, Android) and also when running the iOS app on a M1 Pro MacBook Pro there is no such problem.
As there is no command line output or anything I am quite clueless what could cause this behaviour. [Here is a](https://drive.google.com/file/d/1mfuVRFlCDg6VIA6DB9rmNJYVadH2aagW/view?usp=share_link) .zip with the dart plugin. Inside the example folder is an example demonstrating the problem. It is setup to run on MacOS and iOS. Pressing the ActionButton invokes the plugin and shows the delay on iOS.
What could cause this?
Contributor guide
Assessment
This issue has not been assessed yet.