Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
YouTube Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module talk:InfoboxImage
(section)
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Feedback=== A couple of things to note: * <code><nowiki>mw.loadData</nowiki></code> already caches the data load once per module load (see [https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.loadData]), so there's no need for the new code at sandbox lines 23-26. * Remember that Lua parsing/interpreting time is significant. Thus when you have a long list of data (as in [[Module:InfoboxImage/data]]), it's innately O(n), because the parser has to touch every element anyway. Because of these, my preference is to perform mw.loadData locally within each function. This performs lazy evaluation of loadData -- it's not loaded until its needed. For this module, the lazy load occurs 100% of the time, so it isn't critical at this time. But if someone changes the code in the future, lazy loading could be helpful. If you always load the module at lines 23-26, then you'll always incur the Lua parsing overhead for the data. The conversion of [[Module:InfoboxImage/data]] to use a hash table directly is nice, although won't help performance. Because the time is dominated by Lua parsing, the conversion of the list to a hash (which only happens once one module load) will not be noticable. Also: please don't remove comments from the code. They're helpful for future developers. β [[User:Hike395|hike395]] ([[User talk:Hike395|talk]]) 15:08, 4 June 2026 (UTC) :Thank you for the excellent feedback, [[User:Hike395|hike395]]. You make a very sharp point regarding the Scribunto environment mechanics and the overhead of Lua parsing time versus execution loops. I have fully updated the sandboxes to incorporate your suggestions, balancing the structural improvements with the engine's best practices: :* '''Lazy Loading Implemented:''' I removed the module-level eager loading of the data submodule. The call to <code>mw.loadData('Module:InfoboxImage/data/sandbox')</code> has been moved locally inside <code>trackingCat</code> and <code>i.IsPlaceholder</code>. This ensures that the data layer is only processed when actually needed, preventing unnecessary overhead if the module's scope changes in the future. :* '''Comments and Assertions Restored:''' All documentation comments and essential logical descriptions have been added back to ensure readability and maintainability for future developers. :* '''Hash Table & Bug Fix Retained:''' The data submodule structure remains as a direct lookup hash table (which, as you noted, provides a cleaner and more native design even if parsing time dominates), and the critical fix for the bypassed alt-text validation keyword filter is intact. :The [[Module:InfoboxImage/sandbox]] and [[Module:InfoboxImage/data/sandbox]] are now fully aligned with both performance optimization and proper lazy-evaluation architecture. If there are no further objections, I will proceed with the official Edit Request. Thanks again for the review! --[[User:GKNishimoto|GKNishimoto]] ([[User talk:GKNishimoto|talk]]) 16:57, 4 June 2026 (UTC)
Summary:
Please note that all contributions to YouTube Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
YouTubeWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Module talk:InfoboxImage
(section)
Add topic