Heatmap data needs to be optimized #9506

Closed
opened 2025-11-02 08:41:07 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @silverwind on GitHub (Sep 3, 2022).

A regular page load is about 30-40ms rendering time but any page containing heatmap data like the homepage, drastically increases page rendering time to around 200-400ms. We should find ways to optimize this.

Originally created by @silverwind on GitHub (Sep 3, 2022). A regular page load is about 30-40ms rendering time but any page containing heatmap data like the homepage, drastically increases page rendering time to around 200-400ms. We should find ways to optimize this.
GiteaMirror added the type/enhancementperformance/speed labels 2025-11-02 08:41:07 -06:00
Author
Owner

@lunny commented on GitHub (Jul 3, 2023):

Does #23574 resolve this partially?

@lunny commented on GitHub (Jul 3, 2023): Does #23574 resolve this partially?
Author
Owner

@silverwind commented on GitHub (Jul 3, 2023):

No that is unrelated. The problem with heatmap data, IIRC is both that the backend database query is expensive (primary issue), and that the JSON format that is dumped into the HTML is inefficient.

@silverwind commented on GitHub (Jul 3, 2023): No that is unrelated. The problem with heatmap data, IIRC is both that the backend database query is expensive (primary issue), and that the JSON format that is dumped into the HTML is inefficient.
Author
Owner

@lunny commented on GitHub (Jul 3, 2023):

Since it's by day, maybe we can store the result in some table.

@lunny commented on GitHub (Jul 3, 2023): Since it's by day, maybe we can store the result in some table.
Author
Owner

@silverwind commented on GitHub (Jul 3, 2023):

Some form of cache would be needed I guess. Note that users can push commits for previous or even future dates, so it would have to be invalidated on every user push.

@silverwind commented on GitHub (Jul 3, 2023): Some form of cache would be needed I guess. Note that users can push commits for previous or even future dates, so it would have to be invalidated on every user push.
Author
Owner

@lafriks commented on GitHub (Jul 9, 2023):

We do not show commits in heatmap but only user actions so they can be only with current date not in the past or future.

Previously when I implemented it it was returning data already summed up by day but it was reworked later on to return all data to fronted to account user timezone

@lafriks commented on GitHub (Jul 9, 2023): We do not show commits in heatmap but only user actions so they can be only with current date not in the past or future. Previously when I implemented it it was returning data already summed up by day but it was reworked later on to return all data to fronted to account user timezone
Author
Owner

@silverwind commented on GitHub (Jul 9, 2023):

Data format is currently

[{"timestamp":1657821600,"contributions":1}]

It could at least be minified to

[[1657821600,1]]

Still I think real performance increase can only come from some form of caching.

@silverwind commented on GitHub (Jul 9, 2023): Data format is currently ```json [{"timestamp":1657821600,"contributions":1}] ``` It could at least be minified to ```json [[1657821600,1]] ``` Still I think real performance increase can only come from some form of caching.
Author
Owner

@lunny commented on GitHub (Sep 24, 2024):

Duplicate of #29769 since more discussion there.

@lunny commented on GitHub (Sep 24, 2024): Duplicate of #29769 since more discussion there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9506