fcfa36ac77376bd47c6ef6c78fc10b9f5363b90e
Add potential items directly to a single array with two indexOf checks. Previously, potential items were first put in a new temporary array, then that array was filtered with indexOf checks into another temporary array, and then the result of that combined with the previous results into another temporary filtered array, and then the previous results array replaced with the new one. This eliminates 2*2N filter+concat calls an their overhead from calling functions, creating arrays, copying arrays and the memory for those arrays. (Where N is the number of language-list strategies). It also reduces the total number of indexOf calls. Below is a comparison of time spent in createCompactList() during page load process, compared to master without this and the previous commit. Measured on localhost with Vector, EventLogging, Interwiki, and ULS installed; on a page that is a copy of en.wikipedia.org/Messier_87 and its 51 interlanguage links. This page was a featured article last week. Its count of links seems average compared to other featured and/or most-viewed articles last week (the other ones I checked had 23, 43, 52, and 76 langlinks respectively). |--------------|----------|--------| | | Before | After | |--------------|----------|--------| | Chrome 69 | 77.5ms | 41.4ms | | MacBook Pro | 57.7ms | 44.4ms | | CPU 1/6th | 63.8ms | 45.3ms | |--------------|----------|--------| | Firefox 61 | 12ms | 10ms | | | 10ms | 9ms | | | 11ms | 8ms | |--------------|----------|--------| | Safari 11 | 3.5ms | 2.7ms | | | 3.3ms | 2.6ms | | | 3.4ms | 2.8ms | |--------------|----------|--------| Bug: T127328 Change-Id: I56052e7c01c6a667500773e12c755a7a5f5d9cd0
== Universal Language Selector == The Universal Language Selector extension (ULS) provides a flexible way to configure and deliver language settings like interface language, fonts, and input methods (keyboard mappings). This will allow users to type text in different languages not directly supported by their keyboard, read content in a script for which fonts are not available locally, or customise the language in which menus are displayed. For more information see: https://www.mediawiki.org/wiki/Universal_Language_Selector == Copying == You may use any Project Milkshake product, including the Universal Language Selector, under the terms of either the MIT License or the GNU General Public License (GPL) Version 2 or later. See GPL-LICENSE and MIT-LICENSE for details. == Installation == For a very, very quick start add the following lines to LocalSettings.php of your MediaWiki setup: wfLoadExtension( 'UniversalLanguageSelector' ); By default, ULS will appear at personal toolbar position. If you want ULS at interlanguage position, add the following line: $wgULSPosition = 'interlanguage'; == For Developers == The MediaWiki Universal Language Selector project uses jquery.uls: https://github.com/wikimedia/jquery.uls Its development is at Wikimedia Github account. Any fixes to lib/ should happen at Github. Follow the build instructions of jquery.uls to create jquery.uls.js. Bugs for the extension are handled in Phabricator: https://phabricator.wikimedia.org/tag/mediawiki-extensions-universallanguageselector/
Description
Languages
JavaScript
79.4%
HTML
11.9%
PHP
4.7%
Less
2.5%
CSS
1.4%
Other
0.1%