# Issue with preloaded data causing x10 slower loading

**URL:** https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612
**Category:** Support
**Created:** [May 18, 2025, 8:09pm UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612 "2025-05-18T20:09:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [May 18, 2025, 8:09pm UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612/1 "2025-05-18T20:09:11Z")

</div>

We noticed the the tracking state in the `data-preloaded` is extremely long particularly for trust level 3 or 4 or users who have been active for a long time.

Is deleting users’ topic tracking states from the db or alternatively removing or limiting it from the above queries going to do any damage? like taking away their badges or trust levels etc.

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [May 19, 2025, 6:21am UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612/3 "2025-05-19T06:21:01Z")

</div>

![This image displays a performance analysis report detailing the load times for various Ruby on Rails application classes in a Linux command-line interface. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/6/4/864cf5d32baef7cca73a4215198a9a12972df5ba.png)

We encountered a similar issue where the query for the topic tracking state consumes approximately 70% of the homepage rendering time. Under high load conditions, this query can even take over 1000 ms to complete.

I think there should be an (optional) approach to make the topic tracking state an asynchronous request, thereby enabling users to view the homepage more swiftly.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [May 19, 2025, 8:35am UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612/4 "2025-05-19T08:35:18Z")

</div>

exactly! I’ve seen up to 3000ms

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [June 12, 2025, 1:14pm UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612/5 "2025-06-12T13:14:55Z")

</div>

I simply remove this line:

 ![# report = TopicTrackingState.report(@guardian: user) # serializer = TopicTrackingStateSerializer.new(report, scope: @guardian, root: false) serializer = TopicTrackingStateSerializer.new(}${{ scope: '@guardian', root: false }}) hash = serializer.as_json (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/0/f/7/0f729850b72ed74470c4b7a155fd626a22baae09.png)

After examining the frontend code, I surmised that my actions might have potentially caused certain issues. However, in practice, upon removing that line and reloading the server, I observed no significant differences, and the load time of my homepage was reduced by approximately 60%.

This serves as a small piece of experiential knowledge for those facing similar performance challenges. Nonetheless, I cannot guarantee the consequences of this action, so proceed at your own risk.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [July 15, 2025, 7:38am UTC](https://meta.discourse.org/t/issue-with-preloaded-data-causing-x10-slower-loading/366612/6 "2025-07-15T07:38:48Z")

</div>

I see the same behavior
