-
Notifications
You must be signed in to change notification settings - Fork 54
perf: 优化较多模组下的搜索表现 #1705
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
base: dev
Are you sure you want to change the base?
perf: 优化较多模组下的搜索表现 #1705
Conversation
tangge233
left a comment
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.
我在寻思要不要给 CE 加入 Rx.NET,这玩意能在部分时候减少许多代码🤔
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceCompResource.xaml.vb
Outdated
Show resolved
Hide resolved
ruattd
left a comment
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.
不对 再看一眼
请把搜索操作改成纯 Async Task 驱动而不是奇怪的混合,另外用 BeginInvoke 而不是 Invoke
This reverts commit 521267e.
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.
Pull request overview
This pull request optimizes search performance when dealing with many modules (issue #1701). The changes appear to focus on improving the search algorithm's efficiency in the Search function within ModBase.vb, likely addressing performance bottlenecks that became apparent when searching through large numbers of modules.
Key Changes (inferred from code analysis):
- Implementation of preprocessing and caching strategies in the search algorithm
- Addition of query preprocessing to avoid repeated string operations
- Introduction of absolute match detection for better search result prioritization
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Since I don't have access to the actual diff of changed files in this PR, I cannot provide a detailed file-by-file review. The code I examined appears to be functional and includes what seem to be optimization-related enhancements to the search functionality, particularly in:
| Area | Description |
|---|---|
| Search Algorithm | The Search function in ModBase.vb includes preprocessing steps and caching mechanisms to improve performance with many entries |
| Favorites Search | The PageDownloadCompFavorites.xaml.vb uses the optimized search function for filtering favorite items |
Note: Without access to the actual PR diff showing which lines were added, modified, or removed, I cannot provide specific feedback on the changes made in this pull request. To provide a thorough review, I would need to see the actual diff that shows what code was changed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ac617a0 to
19d369e
Compare
ruattd
left a comment
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.
哥们要是实在玩不懂 WPF 的异步就算了吧...
玩不会一点(恼)肯定是 WPF 太垃圾了 |
WPF 确实垃圾,但是它的单线程多任务模型跟其他语言也没什么区别... |
|
仅针对这个问题,从操作层面上看,既不需要对模组数量的多少分类讨论,也似乎不需要延时器。一个比较好的解决方案应该是:输入改变时异步启动一个搜索任务,并结束现在正在进行中的上一个搜索任务。当一个搜索任务完成时,更新UI。 |
close #1701