Commit graph

13 commits

Author SHA1 Message Date
Ori Livneh 9fd1639d46 Disable some highlighting for MOUSs
(...modules of unusual size.)

Enabling full syntax highlighting for very long Lua modules can produce DOMs
that have hundreds of thousands of elements and cause browsers to lock up.

I took a count of spans by class (which amounts to a count of tokens by type)
of https://en.wiktionary.org/wiki/Module:languages and came up with:

       sy0:      62545 (symbols)
       br0:      61952 (brackets)
       st0:      39291 (strings)
       kw3:       7746 (keywords)
       kw1:          3
       kw2:          2
       co2:          2
       co1:          2
       nu0:          1
     ------     ------
     Total:     171544

GeSHi allows you to disable highlighting for a particular token type (see
<http://qbnz.com/highlighter/geshi-doc.html#disabling-lexics>) which like a
good way of handling this issue.

Disabling symbols (set_symbols_highlighting(false)) removes both sy0 and br0
elements from the DOM (about 124k elements in the case of Module:languages),
with about 47k elements remaining on the page. This is enough to make Chromium
responsive on my laptop (2.3ghz i5, 8 GB RAM), but it's still noticeably
sluggish. Adding 'set_string_highlighting(false);' removes another 40k elements
from the rendered output, and the resulting DOM is quite zippy at 8k elements.

Proposed solution: disable symbols highlighting when >100 kB; disable strings
highlighting too when >200 kB.

Change-Id: I90c645f9d03bbdc135058a3717a463dec40aa77d
2013-02-20 22:06:59 -08:00
Sam Reed 21b45c109a Followup r82476, update README 2011-02-19 20:34:08 +00:00
Sam Reed 9c65505f55 SyntaxHighlight_GeSHi: updated to GeSHi 1.0.8.9 2010-10-07 09:55:22 +00:00
Max Semenik 4bc99c4807 SyntaxHighlight_GeSHi: updated to GeSHi 1.0.8.8 2010-07-15 09:17:52 +00:00
Shinjiman 4b1795b001 follow up r64069, update the readme file corresponding URL on SF.net via SVN. 2010-03-23 12:51:37 +00:00
Niklas Laxström a157b2072a Typo fix
What's up with the date in the future? :)
2009-12-30 12:44:18 +00:00
Max Semenik 655655cf75 Per Chad's suggestion on r60489 CR, updated compatibilty notice and moved in from source file to README. 2009-12-30 12:02:04 +00:00
Chad Horohoe 60e453d99a Update last checked version. Also, the ExtensionDistributor bundles the geshi directory, so make a note in README so people don't download it a 2nd time :) 2009-08-05 22:33:30 +00:00
Shinjiman db3b1fd15e adding download method via SVN for GeSHi 2007-12-03 01:43:35 +00:00
Rob Church 44c0c3c72c More direct download link 2007-06-29 04:35:39 +00:00
Antoine Musso 5831473236 URL for this extension page 2007-05-18 21:07:35 +00:00
Tim Starling 01e73b1b19 Renaming 2007-04-03 22:44:40 +00:00
Tim Starling 1e966534f8 Renaming syntax highlighting extensions 2007-04-03 22:34:07 +00:00