Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap data needs to be optimized #21045

Closed
silverwind opened this issue Sep 3, 2022 · 7 comments
Closed

Heatmap data needs to be optimized #21045

silverwind opened this issue Sep 3, 2022 · 7 comments
Labels
performance/speed performance issues with slow downs type/enhancement An improvement of existing functionality

Comments

@silverwind
Copy link
Member

silverwind commented 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.

@silverwind silverwind added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/enhancement An improvement of existing functionality performance/speed performance issues with slow downs and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Sep 3, 2022
@lunny
Copy link
Member

lunny commented Jul 3, 2023

Does #23574 resolve this partially?

@silverwind
Copy link
Member Author

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.

@lunny
Copy link
Member

lunny commented Jul 3, 2023

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

@silverwind
Copy link
Member Author

silverwind commented 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.

@lafriks
Copy link
Member

lafriks commented 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

@silverwind
Copy link
Member Author

silverwind commented 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.

@lunny
Copy link
Member

lunny commented Sep 24, 2024

Duplicate of #29769 since more discussion there.

@lunny lunny closed this as completed Sep 24, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
performance/speed performance issues with slow downs type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants