feat(benchmark): add benchmarking framework to establish an FFI migration baseline#778
Open
WutangNailao wants to merge 6 commits into
Open
feat(benchmark): add benchmarking framework to establish an FFI migration baseline#778WutangNailao wants to merge 6 commits into
WutangNailao wants to merge 6 commits into
Conversation
- add benchmark runner, case registry, API collector, report generator, and image comparator - add multi-resolution benchmark sample data and generated benchmark artifacts - update .pubignore to exclude benchmark/ from published package
Introduce an optional Rust-backed FFI backend for selected image transform operations and document how native acceleration is distributed and consumed. This change adds a native transform backend entry point to the public API and updates `copyCrop` and `copyResize` to opportunistically use native implementations when the requested operation matches supported fast paths. When native acceleration is unavailable or the operation requires unsupported features, both methods transparently fall back to the existing Dart implementations to preserve current behavior and compatibility. Changes included: - document optional native acceleration support in README - clarify that precompiled native binaries are shipped with the package - note that a local Rust toolchain is not required for standard package usage - mention iOS XCFramework distribution for combined device/simulator support - export `transform_backend.dart` from the main library surface - refactor `copyCrop` to delegate to `tryNativeCopyCrop` for non-rounded crops - move Dart crop logic into `copy_crop_dart.dart` as the fallback path - refactor `copyResize` to delegate to `tryNativeCopyResize` for supported fixed-size resize operations - move Dart resize logic into `copy_resize_dart.dart` as the fallback path - add FFI/code asset dependencies required for native integration - add `ffigen` as a dev dependency for native binding generation - update SDK constraint to `^3.10.0` Behavior notes: - native crop is only attempted when `radius == 0` - native resize is only attempted for explicit `width` + `height` requests without aspect-preserving layout or background fill requirements - all unsupported cases continue to use the pure Dart implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
To support the upcoming FFI migration in
image, we need a repeatable and measurable performance baseline first, so we can evaluate before/after changes with a consistent methodology.What’s included
This PR introduces benchmark infrastructure:
benchmark/results.json).Usage Examples
Why this matters
Follow-ups