# סימון פוסט בנושא גדול יוצר זמני טעינה אבסורדיים

**URL:** <https://meta.discourse.org/t/bookmarking-a-post-on-a-large-topic-creates-absurd-loading-times/168041>\
**Category:** Bug\
**Created:** [23 באוקטובר,‏ 2020,‏ 5:01am UTC](https://meta.discourse.org/t/bookmarking-a-post-on-a-large-topic-creates-absurd-loading-times/168041 "2020-10-23T05:01:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [26 באוקטובר,‏ 2020,‏ 1:22am UTC](https://meta.discourse.org/t/bookmarking-a-post-on-a-large-topic-creates-absurd-loading-times/168041/5 "2020-10-26T01:22:26Z")

</div>

I created an account on the Roblox forum to look at [What are you working on currently? (2020) - #5043 by FLYSLENDY04 - Creations Feedback - Developer Forum | Roblox](https://devforum.roblox.com/t/what-are-you-working-on-currently-2020/419774/5043), and I can reproduce the issue there. Without a bookmark the topic loads in ~1.3s, with a bookmark it takes ~8s. I even encountered the 502 bad gateway:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/5/b554be3bdbeb1e563d8660dfcaecef122488f64f.png)

However, I made a topic with 5000 posts locally and made a bookmark, and it loads in the same time whether I have a bookmark in the topic or not 🤷‍♂️. I will have to keep looking…the code that loads the bookmarks for a user in a topic is here:

> <https://github.com/discourse/discourse/blob/9aa2723d57cf9edaad0873ba64d3d1e5a9d7fdc7/lib/topic_view.rb#L443-L445>

And the code that finds a bookmark for each post is here:

> <https://github.com/discourse/discourse/blob/9aa2723d57cf9edaad0873ba64d3d1e5a9d7fdc7/app/serializers/post_serializer.rb#L361-L364>

To me this does not look crazy and performance intensive. `user_post_bookmarks` will only query the database once because it is memoized, so no N1 issue here. Also here is the topic view code to see if there is a bookmark at the topic level:

> <https://github.com/discourse/discourse/blob/9aa2723d57cf9edaad0873ba64d3d1e5a9d7fdc7/app/serializers/topic_view_serializer.rb#L190-L200>

> <https://github.com/discourse/discourse/blob/9aa2723d57cf9edaad0873ba64d3d1e5a9d7fdc7/lib/topic_view.rb#L346-L354>

Nothing suspicious there either…

---

_[View the full topic](https://meta.discourse.org/t/bookmarking-a-post-on-a-large-topic-creates-absurd-loading-times/168041)._
