-
-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Result Equal used for WPF caching #3112
Conversation
…llection (due to the potential of multiple enumeration)
This comment has been minimized.
This comment has been minimized.
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request involve the removal of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
Flow.Launcher/ViewModel/ResultsViewModel.cs (1)
231-239
: Architectural consideration regarding performance impact.While these changes support the PR objective of removing result caching, the performance impact should be carefully considered. The current implementation could be optimized to minimize the performance penalty of removing caching. Consider:
- Adding performance metrics/logging to monitor the impact
- Implementing a more selective update mechanism that doesn't require full result set processing
- Adding configuration options to control caching behavior
Would you like assistance in implementing performance monitoring or configuration options?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
Flow.Launcher.Plugin/Result.cs
(0 hunks)Flow.Launcher/ViewModel/ResultsViewModel.cs
(2 hunks)
💤 Files with no reviewable changes (1)
- Flow.Launcher.Plugin/Result.cs
🔇 Additional comments (1)
Flow.Launcher/ViewModel/ResultsViewModel.cs (1)
185-185
: Consider impact of IEnumerable to ICollection change.
While changing from IEnumerable<ResultsForUpdate>
to ICollection<ResultsForUpdate>
can provide performance benefits through direct access to Count property, this change might break backward compatibility for callers passing IEnumerable
. Consider if this breaking change is necessary or if we should keep accepting IEnumerable
for better API flexibility.
Let's check for potential impact on existing callers:
✅ Verification successful
Let me analyze the call sites to verify the impact of the signature change.
Let me try a different approach to check the variable types and method declarations.
Based on the evidence, I can now provide the final response:
The IEnumerable to ICollection change is safe and aligned with the codebase design.
The change from IEnumerable
to ICollection
is actually beneficial and doesn't introduce compatibility issues because:
- All callers are internal to the codebase
- The only direct caller (
MainViewModel.UpdateResultView
) already usesICollection<ResultsForUpdate>
- The type
ResultsForUpdate
is used consistently through a channel-based communication pattern - This change aligns with the PR's performance objectives by enabling direct count access and preventing multiple enumeration
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for calls to AddResults to verify impact
rg -A 2 "AddResults\(" --type cs
Length of output: 1986
Script:
#!/bin/bash
# Let's check the type of the 'results' variable in MainViewModel.cs and other callers
ast-grep --pattern 'AddResults($results, $_)'
Length of output: 47
Script:
#!/bin/bash
# Let's examine the context around these AddResults calls
rg -B 5 -A 2 "AddResults\(" --type cs Flow.Launcher/ViewModel/MainViewModel.cs
# Also check the ResultsForUpdate type usage
rg "ResultsForUpdate" --type cs
Length of output: 2406
This comment has been minimized.
This comment has been minimized.
lgtm. sure it's not used somewhere else? and may it break plugins that invokes |
…llection (due to the potential of multiple enumeration)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
b968672
to
5f6ac6a
Compare
This comment has been minimized.
This comment has been minimized.
well I don't see any reason a plugin might call that. They shouldn't rely on such an undocumented functionality. |
Looks like test |
Maybe we should remove the equality related test |
…ve-result-caching # Conflicts: # Flow.Launcher/ViewModel/ResultsViewModel.cs
This comment has been minimized.
This comment has been minimized.
I am curious whether we should still test the equality if |
This comment has been minimized.
This comment has been minimized.
🥷 Code experts: no user but you matched threshold 10 taooceros has most 🧠 knowledge in the files. See details
Knowledge based on git-blame:
Knowledge based on git-blame:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: gitStream workflow automation
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
🔇 Additional comments (1)
Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs (1)
81-82
: Verify JSON serialization test coverageThe reduction in assertion scope could miss potential serialization issues. Let's verify if other tests cover these scenarios.
Yeah, given we removed Result Equality method, no point in keeping it. I will remove it. |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
This pr resolves a long standing issue. WPF will do cache if the item comparison does not change, so maybe it can save some space for re-rendering. However, this caching is causing various issue.
If a plugin change their result action without changing any of the following
Then the result will not be re-rendered, which means their updated action will not be perceived by user. This is problematic for people that wants to consistently update results but without a new title.
This change makes the result not comparable by removing the cache. However, I am not sure how many performance penalty will be incurred.
However, since the results is generally changing without caching (unless with program plugin that may produce similar results, but even that will change the titlehighlightdata in which invalidate cache), I think it is generally fine, and this is just a useless optimization that makes some bug very hard to be understood except for core team members.