⚡ Bolt: optimize BaselineManager loadBaseline performance - #78
Conversation
…le stats Replaces repeated synchronous `statSync()` disk I/O operations inside a list `.sort()` comparator with a single asynchronous pass that caches the modification times. This transforms an O(N log N) disk access bottleneck into an O(N) async setup, drastically improving file sorting performance in directories with multiple baselines. Co-authored-by: assassinaj602 <150547310+assassinaj602@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
The CI build failed because the `fllama` dependency requires a `minSdkVersion` of at least 23, while the example app defaulted to `flutter.minSdkVersion` (which is 21). This caused an AndroidManifest merger error. Updating `minSdk` to 23 in the example app's `build.gradle.kts` resolves the CI build failure. Co-authored-by: assassinaj602 <150547310+assassinaj602@users.noreply.github.com>
Resolves CI build failures caused by Android manifest merger errors. The `fllama` dependency requires a `minSdkVersion` of at least 23, but the example app was defaulting to `flutter.minSdkVersion` (which is 21 in this setup). Explicitly setting `minSdk` to 23 fixes the issue. Co-authored-by: assassinaj602 <150547310+assassinaj602@users.noreply.github.com>
💡 What: Optimized
loadBaselineinlib/src/core/baseline_manager.dartto cache file modification times asynchronously before sorting them.🎯 Why: The previous code called
statSync()synchronously within the.sort()comparator. Because sorting algorithms evaluate comparators O(N log N) times, this caused unnecessary and repeated synchronous file I/O operations, blocking the Dart event loop and slowing down baseline resolution.📊 Impact: Reduces synchronous blocking disk operations from O(N log N) to 0, converting it to O(N) asynchronous file checks. This ensures fast execution even with many baseline files.
🔬 Measurement: Verified that all 162+
sate_aitests continue to pass. The baseline manager accurately identifies the most recently modified baseline JSON file in an optimized manner.PR created automatically by Jules for task 16496298305034612531 started by @assassinaj602