mediawiki-extensions-Scribunto/includes/Engines/LuaCommon/lualib
theknightwho fc3104e9c6 Optimisations for mw.clone
`mw.clone` is called on the global table for each new `{{#invoke:}}`,
which is a major contributor to loading times on large pages. This
change introduces various speed optimisations that make it around
15% faster:

* `recursiveClone` is declared outside of the main function, to avoid
  generating a new closure each time `mw.clone` is called.
* This means `tableRefs` has to be passed as an argument to
  `recursiveClone` instead of being an upvalue, which also decreases
  access time.
* `recursiveClone` is only called after a `type` then `tableRefs` check
  confirms a value is an unseen table, meaning it's only called when
  needed, not for every key/value pair (which add noticeable overhead
  when cloning large tables).
* `getmetable` is only called once, not twice, by using a local
  variable.
* `tableRefs[elt]` is only accessed once, by using a ternary operator.
* Any global accesses have been replaced by local ones.

Bug: T357199
Change-Id: I51593a971f0be728255723ca300d1ce692ead256
2024-05-24 02:08:41 +00:00
..
luabit LuaBit: Minor cleanup 2023-12-18 23:46:16 +00:00
ustring Capitalise Engines folder 2022-09-30 00:58:27 +00:00
bit32.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
libraryUtil.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mw.hash.lua Hide mw.hash.setupInterface from users 2022-10-08 22:01:00 +00:00
mw.html.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mw.language.lua LanguageLibrary: Ensure language code is a string 2024-04-11 16:20:24 +00:00
mw.lua Use correct variable for error message in mw.loadJsonData 2024-05-15 14:05:32 +01:00
mw.message.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mw.site.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mw.text.lua Synchronize mw.text.nowiki() with wfEscapeWikiText in core 2024-02-15 05:29:36 +00:00
mw.title.lua mw.title: add pageLang property 2024-01-17 18:20:06 +00:00
mw.uri.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mw.ustring.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
mwInit.lua Optimisations for mw.clone 2024-05-24 02:08:41 +00:00
package.lua Capitalise Engines folder 2022-09-30 00:58:27 +00:00
strict.lua Add strict.lua to replace "Module:No globals" 2022-10-13 04:39:21 +00:00