-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
perf: only generate data-comment-url once #17618
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
Conversation
- Resolves go-gitea#17167 - Don't generate the same `data-comment-url` over and over for each edited LOC. - Set `data-comment-url` for top-table of diff output. Data for diff with 2.5K additons 0 edits 0 deletions: ``` No-patch: Split: 2.82 MB Unified: 2.37 MB Patch: Split: 2.59 MB (-8.2%) Unified: 2.15 MB (-9.3%) ```
I don't quite understand why this has such a big performance impact. I thought variables like If there is significant computation involved when substituting vars in templates, we ought to apply this technique to a lot more variables. |
I think, I've missed the nail by naming this PR - it's a performance improvement in the sense that the size that's being sent to the client is smaller as the repeated attribute is not in each new LOC, but instead only sent once into a top-element. |
LGTM. More thoughts:
|
It likely can not without |
- Don't sent it with each line, instead send it at the top-element for each file. - Related: go-gitea#17618 (comment) 2.5K Additions: No-Patch: Unified: 2.14 MB (2.14 MB size) Split: 2.59 MB (2.59 MB size) Patch: Unified: 2.10 MB (2.10 MB size) (-1.8%) Split: 2.55 MB (2.55 MB size) (-1.5%)
- Don't sent it with each line, instead send it at the top-element for each file. - Related: #17618 (comment) 2.5K Additions: No-Patch: Unified: 2.14 MB (2.14 MB size) Split: 2.59 MB (2.59 MB size) Patch: Unified: 2.10 MB (2.10 MB size) (-1.8%) Split: 2.55 MB (2.55 MB size) (-1.5%)
- Don't sent it with each line, instead send it at the top-element for each file. - Related: go-gitea#17618 (comment) 2.5K Additions: No-Patch: Unified: 2.14 MB (2.14 MB size) Split: 2.59 MB (2.59 MB size) Patch: Unified: 2.10 MB (2.10 MB size) (-1.8%) Split: 2.55 MB (2.55 MB size) (-1.5%)
data-comment-url
over and over for eachedited LOC.
data-comment-url
for top-table of diff output.Data for diff with 2.5K additons 0 edits 0 deletions: