Closed
Bug 663255
Opened 13 years ago
Closed 13 years ago
File/diff viewer is extremely computationally intensive and often yields unresponsive script warnings
Categories
(addons.mozilla.org Graveyard :: Admin/Editor Tools, defect, P3)
addons.mozilla.org Graveyard
Admin/Editor Tools
Tracking
(Not tracked)
RESOLVED
FIXED
4.x (triaged)
People
(Reporter: kmag, Unassigned)
Details
(Whiteboard: [ReviewTeam])
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110513 Firefox/6.0a1 Build Identifier: For especially large files, the file/diff viewer takes an extraordinary amount of time to become responsive, often yielding several unresponsive script dialogs. Oddly, pressing Stop Script often leaves a seemingly feature-complete view of the file. Even smaller files often show a significant lag on page change. The lyz.js file in the following package is an especially pronounced example: https://addons.mozilla.org/en-US/firefox/files/browse/119634/#top Reproducible: Always
Comment 1•13 years ago
|
||
Looks like we're using http://code.google.com/p/google-diff-match-patch/ (which is an enormous JS file). I'm happy to hear alternatives or improvements.
Reporter | ||
Comment 2•13 years ago
|
||
I'm not sure that's the problem, because as far as I can tell, that only runs on diff pages and this also happens on non-diff pages. I initially thought it might be the syntax highlighting, but even stopping the script, everything appears to be highlighted properly. I'll have to see if I can get some more information out of Venkman.
Reporter | ||
Comment 3•13 years ago
|
||
Huh. Interesting. According to Firebug, diff_main() seems to be the main culprit (along with quite a lot of time spent in jQuery).
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Whiteboard: [required amo-editors]
Target Milestone: --- → Q2 2011
Comment 4•13 years ago
|
||
The syntax highlighter we're using is http://alexgorbatchev.com/SyntaxHighlighter/ Are you saying it's our code or a libraries code that is being slow?
Target Milestone: Q2 2011 → 4.x (triaged)
Reporter | ||
Comment 5•13 years ago
|
||
I'm thinking that your first guess was right, given that the diff_main routine seems to be the main consumer, I just don't understand why that should be so. I can't really do much in the way of profiling on the production server, since all of the code there is compressed. I does appear that something is wrong, though, given that the pages appear to display properly even after stopping the script.
Comment 6•13 years ago
|
||
scripts aren't compressed on addons.allizom.org
Reporter | ||
Comment 7•13 years ago
|
||
Hm. I tried there. I suppose that it's because the standard jQuery and diff distributions are shipped compressed that I got such unsatisfactory profiling output.
Comment 8•13 years ago
|
||
https://addons.allizom.org/en-US/firefox/files/browse/119634/file/chrome/content/lyz/lyz.js#top Is much faster, from bug 661947. There's four parts: the diff (if relevant), the syntax highlighting, the line numbering, the diff bar. In this case I sped up the line numbering an awful lot, that was the main problem with this file.
Comment 9•13 years ago
|
||
I think this has been fixed up since this bug, especially with the validation results patch landing. -> fixed
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•13 years ago
|
||
This is still a problem, although it's gotten somewhat better, I think. I still get unresponsive scripts several times a day.
Comment 11•13 years ago
|
||
I tried the link above and it was super fast. Do you have any add-ons installed slowing it down maybe? (just a thought). Anyone else have the problem?
Comment 12•13 years ago
|
||
I almost never hit these warnings, but then again I don't review as much as Kris. Andrew, do you experience this problem often, or at all?
Reporter | ||
Comment 13•13 years ago
|
||
I'll provide a link the next time I see it. I think the file linked above was a special case.
Reporter | ||
Comment 14•13 years ago
|
||
This still causes problems for me: https://addons.mozilla.org/files/compare/139531...132249/file/chrome/content/ih.js#top
Comment 15•13 years ago
|
||
Page took a couple seconds to load, but no warnings for me.
Reporter | ||
Comment 16•13 years ago
|
||
I should note that this is with a test profile with only a few trivial add-ons installed.
Reporter | ||
Comment 17•13 years ago
|
||
For me it spun my CPU for 20 seconds before I got the unresponsive script warning.
Reporter | ||
Comment 18•13 years ago
|
||
I should also note, to put this into perspective, that I was at the MozCamp.de editors meeting and mine was one of the more powerful computers there.
Reporter | ||
Comment 19•13 years ago
|
||
Here's another: https://addons.mozilla.org/files/browse/138903/file/content/facebookhidenames.js#top Although, a 12,000 line JS file... honestly... We should probably just disable highlighting in those cases.
Comment 20•13 years ago
|
||
(In reply to Jorge Villalobos [:jorgev] from comment #12) > I almost never hit these warnings, but then again I don't review as much as > Kris. Andrew, do you experience this problem often, or at all? I used to get warnings on large files but it seems to be loading with only 2-3 second freeze now (on https://addons.mozilla.org/files/browse/138903/file/content/facebookhidenames.js). There ideally shouldn't be any page/chrome freeze I suppose but its acceptable atm imo.
Comment 21•13 years ago
|
||
(In reply to Kris Maglione [:kmag] from comment #14) > This still causes problems for me: > > https://addons.mozilla.org/files/compare/139531...132249/file/chrome/content/ > ih.js#top Same as Wil, it took a couple of seconds, but loaded just fine. This is on my main profile, with a couple of heavy extensions installed.
Reporter | ||
Comment 22•13 years ago
|
||
Well, on my i5 MacBook Pro they load pretty fast. But that's not saying much. On my day-to-day machine, which I know outpaces what most other editors use, it's still an issue.
Comment 23•12 years ago
|
||
Reclassifying editor bugs and changing to a new whiteboard flag. Spam, spam, spam, spam...
Whiteboard: [required amo-editors] → [ReviewTeam]
Assignee | ||
Updated•8 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•