RESOLVED FIXED 20346
Speed up the JavaScript syntax highlighter by generating the finders only once
https://bugs.webkit.org/show_bug.cgi?id=20346
Summary Speed up the JavaScript syntax highlighter by generating the finders only once
Timothy Hatcher
Reported 2008-08-11 11:22:24 PDT
The syntax highlighter can be speed up more by generating the finders only once when syntaxHighlightJavascript is called, not per line.
Attachments
Proposed patch (ignoring whitespace changes) (6.93 KB, patch)
2008-08-11 11:29 PDT, Timothy Hatcher
aroben: review+
Proposed patch (full patch) (12.73 KB, patch)
2008-08-11 11:29 PDT, Timothy Hatcher
no flags
Timothy Hatcher
Comment 1 2008-08-11 11:29:14 PDT
Created attachment 22730 [details] Proposed patch (ignoring whitespace changes)
Timothy Hatcher
Comment 2 2008-08-11 11:29:52 PDT
Created attachment 22731 [details] Proposed patch (full patch)
Adam Roben (:aroben)
Comment 3 2008-08-11 11:38:09 PDT
Comment on attachment 22730 [details] Proposed patch (ignoring whitespace changes) + Removed, factoeed into syntaxHighlightJavascript as an inline function. Typo: factoeed - var findSingleLineString = generateFinder(/^"(?:[^"\\]|\\.)*"|^'([^'\\]|\\.)*'/, 0, "webkit-javascript-string"); + var findSingleLineString = generateFinder(/^"(?:[^"\\]|\\.)*"|^'([^'\\]|\\.)*'/, 0, "webkit-javascript-string"); // " Why this change? r=me
Timothy Hatcher
Comment 4 2008-08-11 11:47:04 PDT
(In reply to comment #3) > (From update of attachment 22730 [details] [edit]) > - var findSingleLineString = > generateFinder(/^"(?:[^"\\]|\\.)*"|^'([^'\\]|\\.)*'/, 0, > "webkit-javascript-string"); > + var findSingleLineString = > generateFinder(/^"(?:[^"\\]|\\.)*"|^'([^'\\]|\\.)*'/, 0, > "webkit-javascript-string"); // " > > Why this change? Needed to keep Xcode's syntax highlighting sane. I added some words to that comment.
Timothy Hatcher
Comment 5 2008-08-11 11:48:51 PDT
Landed in r35669.
Note You need to log in before you can comment on or make changes to this bug.