Board Thread:Lua Help/@comment-4405550-20160107031030/@comment-4405550-20160107213809

Cqm wrote: I think there's a difference between minification and optimisation, the latter of which is closer to what you're suggesting. Correct, and I agree code should be readable. I actually didn't know Lua code was compiled; I thought it was done at runtime.

So what about a simple optimization suggestion script? Have a js script look through the code and provide tips like: Line 123: Could be rewitten as `if myVar == true or myVar == false then` (Link to documentation for this optimization)

All in a little box off to the side, and no obligation to do what it suggests.

I'm only suggesting this because I've never used Lua before. I know a lot of languages, but Lua is odd and breaks a lot of standard conventions. So it took me a little while to understand how its constructors, classes, and closures work. I only know a few extra optimization tips because I've been reading documentation non-stop for days. So now i'm trying to go back through all my code and apply what I know now.

Optimization is pretty important to me because of pages like this. The entire right infobox is generated from the data provided. And THAT page can be called by another article/template to use the data to generate something like this. Also, the "Upgrade" components on the infobox are pulled from this Lua data module, which is also used to generate the table on this page. So even minor tweaks can have MAJOR effects across the wiki.

So a tool to help suggest performance enhancements, in places I may not think of on my own, would be a huge help to anyone.