dart-native / dart_native

Write iOS&macOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.
BSD 3-Clause "New" or "Revised" License
951 stars 77 forks source link

[documentation] provide benchmark to demostrate statement in readme #82

Open iapicca opened 2 years ago

iapicca commented 2 years ago

your readme states

Replaces the low-performing Flutter channel with faster and more concise code.

I care less about the "concise" part, but your claim that your solution is faster than the first party implementation is interesting could you provide benchmarks that demonstrate your claim?

Additionally, how does this solution perform against pigeon?

yulingtianxia commented 2 years ago

Here is the benchmark: https://github.com/dart-native/dart_native/blob/50e8226e7cf42ff5fe0745193d8e5cac7b04666d/dart_native/example/lib/main.dart#L33

However, it has to be said that the time saved by synchronous calls comes from reducing the overhead of switching threads, which also blocks the flutter-ui thread.

pigeon is a tool for flutter channel. dart_native do not need to define serialization methods such as JSON format, it calls native method directly.