Skip to content
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

⚡️ perf: Improve the performance of refreshModelProviderList. #6672

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

Last-Order
Copy link
Contributor

@Last-Order Last-Order commented Mar 3, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

When setting model availability on the LLM settings page, getEnableModelsById is called thousands of times, causing a performance issue. This PR partially addresses the problem, but further work is needed to fully resolve it.

📝 补充信息 | Additional Information

On my device, the average time for this operation decreased from ~1000ms to ~200ms.

image

Copy link

vercel bot commented Mar 3, 2025

@Last-Order is attempting to deploy a commit to the LobeChat Desktop Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @Last-Order

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. ⚡️ Performance Performance issue | 性能问题 labels Mar 3, 2025
@arvinxx arvinxx changed the title Refactor: Improve the performance of refreshModelProviderList. ⚡️ perf: Improve the performance of refreshModelProviderList. Mar 5, 2025
Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution! This part will be remove in the V2. I think currently the database mode or pglite mode have completely solved this issue

Copy link

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 4:22am

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.61%. Comparing base (dfd1f09) to head (cbc0cb8).
Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6672      +/-   ##
==========================================
+ Coverage   91.56%   91.61%   +0.05%     
==========================================
  Files         716      716              
  Lines       67236    67243       +7     
  Branches     3239     3248       +9     
==========================================
+ Hits        61567    61608      +41     
+ Misses       5669     5635      -34     
Flag Coverage Δ
app 91.61% <100.00%> (+0.05%) ⬆️
server 97.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arvinxx arvinxx merged commit 6006175 into lobehub:main Mar 9, 2025
14 of 16 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @Last-Order ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.69.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡️ Performance Performance issue | 性能问题 released size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants