Closed
Bug 929225
Opened 11 years ago
Closed 9 years ago
Don't fallback to text syntax highlighting mode for large files
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(firefox46 verified)
VERIFIED
FIXED
Firefox 46
Tracking | Status | |
---|---|---|
firefox46 | --- | verified |
People
(Reporter: anton, Assigned: jlong)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.24 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
In the debugger-view.js we have the following code:
if (aTextContent.length >= SOURCE_SYNTAX_HIGHLIGHTING_MAX_FILE_SIZE)
return void this.editor.setMode(Editor.mode.text);
I'm not sure this is still necessary with bug 919709.
Comment 1•11 years ago
|
||
I removed it and loading the asm.js code for http://www.unrealengine.com/html5/ is instant now! But that's on my mac. We need to test this on old hardware too.
Comment 2•11 years ago
|
||
Note that very long lines are still an issue in CM (https://github.com/marijnh/CodeMirror/issues/1022)
Reporter | ||
Comment 3•11 years ago
|
||
Maybe increase the value of SOURCE_SYNTAX_HIGHLIGHTING_MAX_FILE_SIZE?
Comment 4•11 years ago
|
||
I think we should go with a better heuristics to determine the threshold instead of just file size . Even if CM can now load even bigger files faster, it is slow on minified single lined files which are very long. Maybe have a heuristics depending on the max (or median) line size.
Updated•10 years ago
|
Summary: Check whether it is still necessary to use editor's text mode for large files → Check if we still need to switch the editor to text mode for large files
Updated•10 years ago
|
Blocks: dbg-frontend
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jlong
Assignee | ||
Comment 5•9 years ago
|
||
This is very doable now. I tested a 50MB JS file with a line that that 40K chars on it and it was fine. I think we should enable and see if anyone finds problems with it in the wild.
Assignee | ||
Updated•9 years ago
|
Blocks: dbg-large-files
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8697736 [details] [diff] [review]
929225.patch
Review of attachment 8697736 [details] [diff] [review]:
-----------------------------------------------------------------
Brian, I tested this on a huge file and CodeMirror has definitely optimized for this. It probably only highlights the code in the viewport, and doesn't need to parse the code, just uses regexs to match keywords.
Attachment #8697736 -
Flags: review?(bgrinstead)
Comment 7•9 years ago
|
||
Comment on attachment 8697736 [details] [diff] [review]
929225.patch
Review of attachment 8697736 [details] [diff] [review]:
-----------------------------------------------------------------
I'm worried about adding anything that might slow down opening large files since it can still be really janky with huge files, especially on lower memory devices. However I've profiled this and and most of time spent janking on load has nothing to do with highlighting. In my measurements with a 50MB file setting the mode to js took around 73ms while setting it to text took around 55ms. In both cases setting the text in the editor took around 8 seconds total so this is a drop in the bucket. Also, the highlighting runs after the load is done and once the framerate is back up to normal.
::: devtools/client/debugger/debugger-view.js
@@ -409,5 @@
> */
> _setEditorMode: function(aUrl, aContentType = "", aTextContent = "") {
> - // Avoid setting the editor mode for very large files.
> - // Is this still necessary? See bug 929225.
> - if (aTextContent.length >= SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE) {
Please also remove the const at the top of the file
Attachment #8697736 -
Flags: review?(bgrinstead) → review+
Updated•9 years ago
|
Summary: Check if we still need to switch the editor to text mode for large files → Don't fallback to text syntax highlighting mode for large files
Comment 9•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
Comment 10•9 years ago
|
||
[bugday-20160323]
STR:
Please mention "steps to reproduce" clearly for verification during testdays.
Status: RESOLVED -> UNVERIFIED
Component:
Name Firefox
Version 46.0b2
Build ID 20160314144540
Update Channel beta
User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
OS Windows 7 SP1 x86_64
Actual Results:
Ambiguous steps to reproduce problem. So from whatever data is there:
1. On https://bugzilla.mozilla.org/show_bug.cgi?id=929225
2. Open Debugger, there is no file in sources window named as view.js
3. Test fails.
Expected Results:
Please give STR for testing.
Flags: needinfo?(jlong)
Comment 12•9 years ago
|
||
Tested on Win7_64, with 3 scripts ( >1Mb each one):
> [1] data:text/html,<script src="https://s.ytimg.com/yts/jsbin/player-ru_RU-vfl_2nEnm/base.js"></script>
> [2] data:text/html,<script src="https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.ru.FDWJAtZQrp4.O/m=b,prc/am=YE2ChoYAAFA/rt=j/d=1/rs=AGLTcCMFp2P8QX4-zVMpXQ_998diS9a19Q"></script>
> [3] data:text/html,<script src="https://accounts.firefox.com//scripts/main.js"></script>
Fix range:
> https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=d5fd77678f2cef6ca58f2c4b9901e22d375876c5&tochange=063c2822231032a310ad6508daf7a52486ec2e5c
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•