FLUTTER ECOSYSTEM

Rahiche/fast_blurhash

더 빠른 처리를 위해 Rust를 활용한 고성능 Dart FFI 패키지로 BlurHash를 디코딩합니다.

fast_blurhash 프로젝트 이미지
Stars
11
Forks
1
최근 푸시(UTC)
2024. 9. 11.
프로젝트 상태
활성
Raouf Rahiche GitHub avatar
GITHUB User

Raouf Rahiche ↗

London, UK
언어DartC++CMakeRustSwiftHTMLCKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 7 개

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

fast_blurhash

A Dart FFI package project that uses Rust to decode the blurhash and encode the final image, utilizing FFI to call these functions. This package exists because it works +20x faster on average than the common Dart implementation and can be tested in release mode by running the benchmarks.dart demo.

It only works with the latest version of Flutter on the main branch and requires the following feature to be enabled: flutter config --enable-native-assets. For more details, refer to this issue.

Status

  • Uses experimental APIs which might change in the future.
  • The first time call takes longer than the average time so I have added a setup function to do a warmup call.
  • Tested only on iOS and MacOs in release mode.
  • Significant performance difference between release mode and debug mode; do not rely on debug mode results.

Project structure

This template uses the following structure:

  • rust: Contains the rust source code.

  • lib: Contains the Dart code that defines the API of the plugin, and which calls into the native code using dart:ffi.

Benchmarks

To test the performance of the package in release mode, run the benchmarks.dart demo.

So far I have tried this one iOS and macos release mode, don't run the benchmarks on debug mode.

Run the benchmark using : flutter run -t lib/benchmarks.dart --release

iPhone 15 pro:
screenshot from the benchmarks demo on iPhone 15 pro
M1 Macbook Pro:
screenshot from the benchmarks demo on macbook pro