Closed Bug 352615 Opened 19 years ago Closed 16 years ago

[PatchReader] Group empty cells together to reduce the size of the diff page

Categories

(Bugzilla :: Attachments & Requests, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: ispiked, Assigned: LpSolit)

Details

(Keywords: helpwanted, perf)

Attachments

(1 file, 1 obsolete file)

Apparently a <table> is created and <tr>s are used for each /line/ of a patch. This seems wrong to me... there's got to be a way we can do this that isn't reminiscent of the '90s.
Assignee: attach-and-request → ui
Component: Attachments & Requests → User Interface
Summary: attachment.cgi?action=diff abuses tables badly → [PatchReader] attachment.cgi?action=diff abuses tables badly
Severity: normal → minor
The main problem is the size of the generated page: Viewing process_bug.cgi and Bug.pm with context=file generates a page which is 1Mb in size despite both files are much smaller (48 Kb and 113 Kb respectively). We should find a way to decrease the size of the page by at least a factor of 2.
Assignee: ui → attach-and-request
Severity: minor → normal
Component: User Interface → Attachments & Requests
Target Milestone: --- → Bugzilla 4.0
Keywords: helpwanted, perf
Priority: -- → P2
Target Milestone: Bugzilla 4.0 → Bugzilla 3.2
LpSolit is referring to https://bugzilla.mozilla.org/attachment.cgi?id=297468&action=diff&headers=1&context=file I think the way to fix this is to do some smart stuff, ie if there is a + without a - then you could do a rowspan. Otherwise this would be kinda rough.
Priority: P2 → P3
Target Milestone: Bugzilla 3.2 → ---
Attached patch proof of concept using <br>, v1 (obsolete) — Splinter Review
In this patch, I group cells which are of the same kind (context, changed, removed, or added) using <br> for each line within each block. This makes pages to be 40-60% smaller (which is a huge improvement for the bandwidth). The display is fine except that row numbers are no longer aligned with the patch content itself, especially when some lines are wrapped. That's because a newline in a cell cannot adapt itself based on what happens in another cell besides it. So I doubt we can make things better compared to what we have currently, unfortunately (unless there is some magical CSS rule which can fix this for us, but I'm pessimistic).
Attached patch patch, v1Splinter Review
I only use blocks where there is no line numbering so that the UI is not affected at all. Compared to my previous patch, the page size is only reduced by ~6-10% on average, with a higher gain when the patch has a lot of new/removed lines. Another possible improvement would be to remove <pre> and add some CSS rules to existing classes, but this doesn't work well (Firefox, Opera, Safari, Internet Explorer and Google Chrome behave differently), so I leave that for another bug. Also, putting class="num" in <col> instead of repeating it for each row gives weird results. I'm not sure modern browsers support <col> and <colgroup> very well. So I will take this patch for now.
Assignee: attach-and-request → LpSolit
Attachment #387590 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #387645 - Flags: review+
Flags: approval+
Target Milestone: --- → Bugzilla 3.6
Morphing the bug summary to better reflect what I did in my patch. Checking in template/en/default/filterexceptions.pl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/filterexceptions.pl,v <-- filterexceptions.pl new revision: 1.128; previous revision: 1.127 done Checking in template/en/default/attachment/diff-file.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/diff-file.html.tmpl,v <-- diff-file.html.tmpl new revision: 1.8; previous revision: 1.7 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Summary: [PatchReader] attachment.cgi?action=diff abuses tables badly → [PatchReader] Group empty cells together to reduce the size of the diff page
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: