Borwe / kt_vs_dart_vs_rust_vs_wasm

Example app to check performance between Kotlin, Dart, Rust and Wasm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

android_ Kotlin vs Dart vs Rust Vs Wasm

A project written to test performance of the languages Kotlin, Dart, Rust, Wasm and Go on android app by getting how many times a language can get total number prime numbers between a range, in 5 seconds, got the idea from Dave's Garage on Youtube

Build requirements:

  • Rust 1.69+
  • Flutter 3.x+
  • go 1.22+

build rust shared library

  • cargo-ndk. Can be installed via cargo with:

    cargo install cargo-ndk
  • install the necessary toolchains for different android architectures

    rustup target add aarch64-linux-android 
    rustup target add armv7-linux-androideabi 
    rustup target add x86_64-linux-android 
    rustup target add i686-linux-android

Running

First compile the rust library, then move it to jniLibrary dir of android file using cargo-ndk switch to the rust directory and run:

cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -t x86 --no-strip -o ../android/app/src/main/jniLibs build --release

Build golang shared library

To build the shared libraries for different Android architectures,run the bat file for windows or the Makefile for unix systems. ensure that the ndk paths are set correctly.

batch for windows

build_android.bat

Makefile for unix

make android

Run the flutter app

flutter run

or build

flutter build

About

Example app to check performance between Kotlin, Dart, Rust and Wasm

License:MIT License


Languages

Language:Dart 52.7%Language:Kotlin 14.5%Language:Rust 10.0%Language:Go 9.1%Language:Batchfile 7.4%Language:Makefile 6.4%