flarum / issue-archive

0 stars 0 forks source link

Discussion performance #99

Open simon1222 opened 3 years ago

simon1222 commented 3 years ago

Bug Report

Current Behavior When I open the discussion with 126k comments , then flarum retrieves all posts. This behavior is too expensive, because response time is about 6s.

Expected Behavior Load only required posts.

Screenshots image image

Environment

Additional Context I had to turn off follow tags extension and remove loading of tagState (1.2m rows in DB), because response time was much bigger than 6s. But this is issue for flarum/tag.

askvortsov1 commented 3 years ago

then flarum retrieves all posts. This behavior is too expensive, because response time is about 6s.

Not quite. It loads in the ids of all posts: the posts themselves are serialized only when the user scrolls to the appropriate point in the discussion.

I suppose it might be possible to load in the discussion without loading the post IDs, but there are some associated challenges. Also, there's the question of whether 125k post discussions are good UX: often, this might be better solved via a chat, or splitting the discussion into topics. The discourse people have some good thoughts on this.

I had to turn off follow tags extension and remove loading of tagState (1.2m rows in DB), because response time was much bigger than 6s. But this is issue for flarum/tag.

On the bright side, this is likely mostly fixed in the next release: see flarum/framework#2177

luceos commented 3 years ago

@simon1222 can you let us know whether this issue is resolved? Please re-open if not.

rafaucau commented 3 years ago

This discussion which contains 126k is still loading very slowly. We have split it off into a new one.

It will be worth improving the loading of large discussions in Flarum at some point.

askvortsov1 commented 3 years ago

This discussion which contains 126k is still loading very slowly. We have split it off into a new one.

It will be worth improving the loading of large discussions in Flarum at some point.

Possibly a radical idea, but for huge discussions, it might make sense to have an extension that adds a paginated discussion view (like in traditional forums). It'd be relatively easy to do since it's effectively a big theme, and would make load / navigation a bit easier.

SychO9 commented 3 years ago

the implementation for a pagination + infinite scrolling hybrid planned here https://github.com/flarum/core/issues/115#issuecomment-294070243 might solve the issue depending on how it's done.

askvortsov1 commented 3 years ago

the implementation for a pagination + infinite scrolling hybrid planned here #115 (comment) might solve the issue depending on how it's done.

Good point. The most important thing is that it's maximally easy for extension devs to implement various display options (both infinite scrolling and pagination should be available as themes.