XMOJ-Script-dev / XMOJ-Script

XMOJ增强脚本
https://www.xmoj-bbs.me
GNU General Public License v3.0
4 stars 5 forks source link

[Feature Request] 增快讨论加载速度 #18

Closed langningchen closed 11 months ago

langningchen commented 1 year ago

检查项

描述

增快讨论列表的加载速度,速度慢是因为过多的冗余 SQL 数据库查询

原因

太浪费时间

boomzero commented 1 year ago

@PythonSmall-Q @XMOJ-Script-dev/product-managers 快triage

PythonSmall-Q commented 1 year ago

很重要!!!!

PythonSmall-Q commented 1 year ago

emm您的历史遗留问题吧 @langningchen

langningchen commented 1 year ago

对的

PythonSmall-Q commented 1 year ago

嗯我觉得其实这个查找的逻辑没啥毛病以至于我找不到问题所在

langningchen commented 1 year ago

查找什么?

langningchen commented 1 year ago

主要消耗事件在服务器反复多余的 SQL 查询

PythonSmall-Q commented 1 year ago

用户本地存档(?

PythonSmall-Q commented 1 year ago

要不把UserName设置成一个礼拜(?

langningchen commented 1 year ago

不是,是 GetPosts 的时候对于每一个讨论都要查询一次表 bbs_board ,而应该在之前先把 bbs_board 的数据存全部在一个变量里面,每次查询那个变量。还有就是对于每一个讨论还要查询一次表 bbs_reply ,这个会很耗费时间,所以我之前有想到过把 “最后回复” 功能删掉

boomzero commented 1 year ago

我让服务器把db放在east Asia, 然后他给我放到了美国西岸...

On Oct 4, 2023, at 17:49, Chen LangNing @.***> wrote:

主要消耗事件在服务器反复多余的 SQL 查询

— Reply to this email directly, view it on GitHub https://github.com/XMOJ-Script-dev/XMOJ-Script/issues/18#issuecomment-1746525141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AULMJZL2OMKI7KSYUREPSOLX5UWKFAVCNFSM6AAAAAA5QMEENWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBWGUZDKMJUGE. You are receiving this because you were assigned.

boomzero commented 1 year ago

@PythonSmall-Q 你能写一下吗

langningchen commented 1 year ago

@boomzero @PythonSmall-Q 你们俩慢慢弄吧,我现在在忙着这个仓库

PythonSmall-Q commented 1 year ago

目前发帖、回复、短消息速度加快了qwq

boomzero commented 11 months ago

done!

boomzero commented 11 months ago

我开了smart placement

boomzero commented 11 months ago

upd:

image
PythonSmall-Q commented 11 months ago

wow

boomzero commented 11 months ago

PythonSmall-Q commented 11 months ago

Wow!

langningchen commented 11 months ago

@boomzero 🎉 👍 🥇 💯