Go to file
Thiemo Kreuz cfecfbc099 Fix remaining bottleneck in wikitext syntax highlighter
I was wondering why the performance when editing wikitext is
still so bad, and profiled it again. Turns out
StringStream.match() is still the bottleneck (even if already
100 times better than before Icbb1122).

The method is called with many different patterns from
mode/mediawiki/mediawiki.js. I profiled them individually and
found a single outlier. The idea is the same as in Icbb1122.
A pattern that is able to find something *in* a string is
doing nothing but wasting time, as StringStream.match() ignores
every result that is not at the start of the string.

The change adds the missing ^ anchor and wraps the regex pattern
from mw.config.get( 'wgUrlProtocols' ) (that is something like
"ftp:\/\/|http:\/\/|https:\/\/|…") in (?:…), which is a
non-matching group. This is necessary because of the | in the
pattern. The result is a pattern that looks like /^(?:…|…|…)/i.

I remember looking at this code while working on Icbb1122, but
didn't include it in the patch, and then forgot about it.

Bug: T270237
Bug: T270317
Change-Id: Iea2fd116b68704c3186b0edf965006cc7c6eda82
2021-02-05 16:07:40 +01:00
.phan Add phan 2019-04-09 20:35:56 +02:00
i18n Localisation updates from https://translatewiki.net. 2021-01-27 08:33:54 +01:00
includes Provide cookie workaround for setting the feature flag 2021-01-04 16:09:11 +01:00
resources Fix remaining bottleneck in wikitext syntax highlighter 2021-02-05 16:07:40 +01:00
tests build: Updating dependencies 2021-01-29 06:50:49 +00:00
.eslintrc.json build: Update devDependencies 2020-06-12 22:51:38 +01:00
.gitignore Browser tests for CodeMirror (wikitext 2010 editor) 2021-01-08 11:01:13 +01:00
.gitreview Whoops, track not trace 2016-10-24 17:02:17 -07:00
.phpcs.xml Remove @staticvar doc annotation 2018-09-09 20:04:35 +02:00
.stylelintrc.json Update CodeMirror to 5.58.3 2020-12-07 20:20:49 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/phan-taint-check-plugin to 1.3.0 2018-08-19 10:46:12 +00:00
composer.json build: Updating dependencies 2021-01-29 06:50:49 +00:00
COPYING CodeMirror: Add COPYING file and credit for CodeMirror authors 2020-03-02 21:34:06 +00:00
extension.json Log user edit count bucket 2021-01-27 09:03:28 +00:00
Gruntfile.js Rename our customized matchbrackets addon 2021-01-20 11:17:59 +01:00
package-lock.json build: Updating dependencies 2021-01-29 06:50:49 +00:00
package.json build: Updating dependencies 2021-01-29 06:50:49 +00:00