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

[Bug] 设置页面切换 Language Model Tab 异常卡顿 #3937

Closed
ZeekoZhu opened this issue Sep 13, 2024 · 9 comments · Fixed by #5158
Closed

[Bug] 设置页面切换 Language Model Tab 异常卡顿 #3937

ZeekoZhu opened this issue Sep 13, 2024 · 9 comments · Fixed by #5158
Labels
🐛 Bug Something isn't working | 缺陷 Inactive No response in 30 days | 超过 30 天未活跃 ⚡️ Performance Performance issue | 性能问题 released

Comments

@ZeekoZhu
Copy link

📦 部署环境

Official Preview

📌 软件版本

v1.16.12

💻 系统环境

Other Linux

🌐 浏览器

Other

🐛 问题描述

通过左上角打开全局设置后,切换到 Language Model Tab,UI 需要 1 ~ 2 秒才能更新

📷 复现步骤

No response

🚦 期望结果

通过左上角打开全局设置后,切换到 Language Model Tab,UI 在 0.5 秒内完成更新

📝 补充信息

profiler 截图
image

network 截图
image

@ZeekoZhu ZeekoZhu added the 🐛 Bug Something isn't working | 缺陷 label Sep 13, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Sep 13, 2024
@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


📦 Deployment environment

Official Preview

📌 Software version

v1.16.12

💻 System environment

Other Linux

🌐 Browser

Other

🐛 Problem description

After opening the global settings through the upper left corner, switch to the Language Model Tab. The UI will take 1 ~ 2 seconds to update.

📷 Steps to reproduce

No response

🚦 Expected results

After opening the global settings through the upper left corner, switch to the Language Model Tab, and the UI will be updated within 0.5 seconds.

📝 Supplementary information

profiler screenshot
image

network screenshot
image

@lobehubbot
Copy link
Member

👀 @ZeekoZhu

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@dosubot dosubot bot added the ⚡️ Performance Performance issue | 性能问题 label Sep 13, 2024
Copy link

dosubot bot commented Sep 13, 2024

@ZeekoZhu 你好!我是Dosu,一个可以帮助你解决 bug、回答问题,并成为贡献者的机器人。我会在等待人类维护者的过程中帮助你。

I found a similar unsolved discussion regarding performance issues when deploying on Vercel, which might be related to the problem you're experiencing [1].

Potential Causes and Solutions

  1. State Management Bottlenecks:

    • The state management for the global settings UI is handled using selectors, which might cause redundant calculations or unnecessary re-renders if not optimized properly [2].
  2. Memoization Techniques:

    • Ensure that memoization techniques like React.memo and useMemo are used effectively to prevent unnecessary re-renders. The ModelSwitchPanel and ModelSelect components already use these techniques, but you might want to review their implementation for any missed optimizations [3][4].
  3. Lazy Loading and Asynchronous Data Fetching:

    • Implement lazy loading and asynchronous data fetching for the Language Model Tab to improve performance. This can help in reducing the initial load time and make the UI more responsive.
  4. Performance Reports:

    • Review the Lighthouse performance reports for the global settings UI to identify specific areas for optimization. You can find the reports for both desktop and mobile versions here and here [5].
  5. Network Requests:

    • Analyze the network requests to ensure that they are optimized and not causing delays. The provided network screenshot shows multiple fetch requests; consider batching these requests or using caching mechanisms to reduce load times.

By addressing these potential bottlenecks, you should be able to improve the performance of the Language Model Tab and achieve the desired UI update time of under 0.5 seconds.

To continue talking to Dosu, mention @dosu.

@Matinal111
Copy link

确实,近期更新的几个版本在语言模型选项这里变卡顿了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Indeed, several recently updated versions have become stuck in the language model options.

@lobehubbot lobehubbot added the Inactive No response in 30 days | 超过 30 天未活跃 label Nov 13, 2024
@arvinxx
Copy link
Contributor

arvinxx commented Dec 20, 2024

语言模型选项由于承载了过多的 Provider, 30+ 的 provider 共计 100+ 表单字段是导致页面卡顿的根本原因。说实话这么多 provider 也是我们一开始没意料到的,因此这个 RFC( #4859 )会修改设计方案,从根本上解决这个问题。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The language model option carries too many providers. 30+ providers totaling 100+ form fields are the root cause of page lag. To be honest, we did not expect so many providers at the beginning, so this RFC (#4859) will modify the design plan to fundamentally solve this problem.

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Jan 7, 2025
@lobehubbot
Copy link
Member

@ZeekoZhu

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.44.0 🎉

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
🐛 Bug Something isn't working | 缺陷 Inactive No response in 30 days | 超过 30 天未活跃 ⚡️ Performance Performance issue | 性能问题 released
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants