Module talk:Convert: Difference between revisions

Content deleted Content added
Overview: Mentioned at http://test2.wikipedia.org/wiki/User:Johnuniq
problem was frame:preprocess; will update this page with plans soon
Line 10:
 
Usage examples:
*<code><nowiki>{{convert/sandboxlua|5.2|m|ftin}}</nowiki></code> → {{convert/sandboxlua|5.2|m|ftin}}
*<code><nowiki>{{convert/sandboxlua|5+3/8|in}}</nowiki></code> → {{convert/sandboxlua|5+3/8|in}}
*<code><nowiki>{{convert/sandboxlua|60|x|120|m|ft}}</nowiki></code> → {{convert/sandboxlua|60|x|120|m|ft}}
 
Currently, the real master list of unit definitions is a text file on my computer (I have a script to convert that text file to the wikitext used at #5). The uniformly formatted text file is easier for making bulk changes, but will be discarded when the module nears completion.
Line 20:
Module:Convert has many issues to be fixed, and some features that need to be implemented. It does not support inputs with multiple units, such as {{nowrap|<code>3 ft 6 in</code>}}, and does not support large scale units like <code>e3km</code>. Complex units like the <code>hand</code> unit of length have not been implemented, and there are hundreds of unit codes that are not yet defined (the units which are defined are listed at #5).
 
SomeI interestingwant performanceto challengesuse exist.this Thesection "NewPPto limitdocument report" inwhat the htmlmodule sourceis forabout, thisand [[Template:Convert/testcases/bytype/force|testwill page]]update saysthe "Luaabove timeif usage: 0.295s"needed. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 0904:3508, 193 FebruaryMarch 2013 (UTC)
 
==Plans==
I will put an outline of short-term plans here, including possible performance improvements. The following is to remind me what to include.
*[http://test2.wikipedia.org/wiki/User:Johnuniq#Big_tables Big table] Hideous trick to speed up loading a large table.
*[http://test2.wikipedia.org/wiki/User:Johnuniq#mw.loadData mw.loadData] To load a read-only table only once per page; should be deployed at test2 this Monday, and at enwiki a week after that.
[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 04:08, 3 March 2013 (UTC)
 
==Discussion==
<small>My following comment was in "Overview" above; moved to here to keep the overview brief.</small> Some interesting performance challenges exist. The "NewPP limit report" in the html source for this [[Template:Convert/testcases/bytype/force|test page]] says "Lua time usage: 0.295s". [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 09:35, 19 February 2013 (UTC)
::presuming that a page that requires data conversion might require many of them, and consideing the sheer size of [[Module:Convertdata]], you might want to look at the [[mw:Extension:Scribunto/Lua_reference_manual#mw.loadData|mw.loadData documentaion]] and see if you can use this to improve performance. peace - [[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 16:45, 2 March 2013 (UTC)
:::Mentioned at http://test2.wikipedia.org/wiki/User:Johnuniq -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 17:13, 2 March 2013 (UTC)
 
:::Thanks, but this page is a little out of date, and I will update it with the info that WOSlinker linked to. My comment about "performance challenges" was written when I had not absorbed the fact that some testcase timeouts were due to use of <code>frame:preprocess</code>. It actually looks as if Module:Convert is reasonably fast, although I haven't yet hammered it. In [[User:Johnuniq/sandbox|my sandbox]], there are 122 calls of {{tl|convert/sandboxlua}}, and the HTML source shows the Lua time usage is 0.348s (2.8 ms per call). That makes me think that Lua is fast enough even with the current bloated modules. Nevertheless, I'm thinking of some ways I could improve performance and will update the "Plans" section above with info, possibly within a few hours. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 04:08, 3 March 2013 (UTC)