Repository navigation
ביצועים: מעבר בין תוצאות החיפוש בספר בונה מחדש רק את שתי השורות שהבחירה זזה ביניהן - #6134
Merged
Merged
Conversation
…רה זזה ביניהן 54e935c העביר את הבחירה ל-ValueNotifier אחד, כדי שהקטעים לא ייחתכו ויודגשו מחדש. אבל כל שורה גלויה מאזינה לאותו notifier, ולכן כל לחיצה על "התוצאה הבאה" עדיין בונה מחדש את NavTreeContentRow של כל השורות, עם כל העץ שמתחתיו (InkWell, Material, Focus ועוד ~20 widgets לשורה). עכשיו ה-builder מחזיר את אותו מופע של השורה כל עוד הסימון שלה לא השתנה, ו-Flutter מדלג עליו. נבנות מחדש רק השורה שיצאה מהבחירה וזו שנכנסה אליה. 200 תוצאות, 20 לחיצות (test/perf/design_system_hot_paths_perf_test.dart): 16143 -> 3850 בניות, חציון 490ms -> 361ms (debug). Refs Otzaria#1692
Y-PLONI
force-pushed
the
perf/search-result-selection-rows
branch
from
November 27, 2026 09:30
059f18d to
506d8ca
Compare
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.
מה היה איטי
בחלונית החיפוש בתוך ספר טקסט, כל לחיצה על "התוצאה הבאה" או "התוצאה הקודמת", וכל לחיצה על תוצאה, בנתה מחדש את כל שורות התוצאות הגלויות. רק שתי שורות משתנות בפועל: זו שיצאה מהבחירה וזו שנבחרה.
הסיבה
54e935c העביר את הבחירה ל-
ValueNotifierאחד (_selectedResult), כדי שהקטעים לא ייחתכו ויודגשו מחדש בכל לחיצה. אבל כל שורה גלויה מאזינה לאותו notifier, ולכן כל שינוי בבחירה עדיין בונה מחדש אתNavTreeContentRowשל כל שורה, עם כל העץ שמתחתיו (InkWell, Material, Focus, Actions ועוד כ-20 widgets לשורה).התיקון
ה-builder של כל שורה שומר את ה-
NavTreeContentRowהאחרון שבנה. אם הסימון של השורה לא השתנה, הוא מחזיר את אותו מופע ו-Flutter מדלג עליו. השמירה חיה בתוך ה-itemBuilder, ולכן היא נעלמת יחד איתו כשהתוצאות או ההגדרות משתנות. שום התנהגות לא השתנתה: הבחירה, הלחיצה על תוצאה וכפתורי הניווט עובדים כמו קודם.שינוי ב-lib: קובץ אחד, +16/−9 (כולל 2 שורות הערה).
מדידה
200 תוצאות, 20 לחיצות על "התוצאה הבאה". הרתמה הקיימת
test/perf/design_system_hot_paths_perf_test.dart(--plain-name search_results), 5 ריצות לכל הפעלה, במצב debug:לחיצה אחת: 689 בניות לפני, 176 אחרי.
Refs #1692
בדיקות
test/text_book/view/text_book_search_result_selection_rebuild_test.dart: לחיצה אחת על "התוצאה הבאה" בונה מחדש בדיוק 2 שורותNavTreeContentRow, והשורה הנכונה מסומנת. על dev היא נכשלת (Expected 2, Actual 6), ועל הענף היא עוברת.text_book_search_screen.dartאו אתnav_tree_tile.dart(42 קבצים,flutter test -j 1): בענף 569 עברו, 2 דולגו, 0 נכשלו. ב-dev 568 עברו, 2 דולגו, 0 נכשלו (ב-dev אין את הבדיקה החדשה).dart analyzeו-dart format --set-exit-if-changedנקיים על הקבצים ששונו.dart tool/ui_lint_cli.dartמחזיר פלט זהה לזה של dev.git merge-treeמול כל 57 ה-PRים הפתוחים לא מראה אף התנגשות חדשה. תיקון issue #4135 — חיפוש בספר מציג את ההתאמות כשהאינדקס לא מצא דבר #6087 נוגע באותו קובץ בשורות 453–640 בלבד, והשינוי כאן נמצא בשורות 1165–1190.