fast_blurhash는 빠른 계산을 위해 Rust를 활용하여 BlurHash 디코딩을 가속화하는 고성능 Dart FFI 패키지입니다. 낮은 해상도의 플레이스홀더 이미지를 빠르게 생성하고 렌더링할 수 있어, 이미지 로딩 워크플로에서 인식되는 성능 향상에 이상적입니다. 집중적인 작업을 네이티브 Rust 코드로 이관함으로써 순수 Dart 구현보다 CPU 오버헤드를 크게 줄입니다. 이 패키지는 Android, iOS, macOS, Windows, Linux 등 여러 플랫폼을 지원하며, 이미지 로딩 중 매끄러운 시각 피드백이 필요한 크로스플랫폼 애플리케이션에 적합합니다.
사용 사례
빠른 이미지 플레이스홀더 렌더링
향상된 앱 인식 성능
원격 이미지의 효율적인 로딩
실시간 미리보기 생성
배경 이미지 처리
크로스 플랫폼 호환성
주요 기능
Rust 기반 성능
Dart FFI 통합
다중 플랫폼 지원
낮은 메모리 사용량
고속 디코딩
무결점의 Flutter 통합
적합한 대상
중량 이미지 로딩을 하는 앱
성능 중심의 UI
이미지 중심 대시보드
플레이스홀더를 사용한 프로토타이핑
네이티브 속도를 찾는 개발자
고려 사항
로컬 빌드에는 Rust 도구 체인이 필요합니다
BlurHash 디코딩(인코딩 제외)에 한정
플랫폼별 네이티브 종속성
CI/CD에서의 잠재적 빌드 복잡성
앱 바이너리 크기가 약간 증가할 수 있습니다
원본 README
연결된 소스 저장소의 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