1. #1
    Deleted

    Lightbulb Is lua a Just-in-Time compiled language in wow, or just plain scripted?

    I wonder if there is some basic optimization going on. For example, I may write an equation as number= number * number / number (number + number) but if I know there is some basic optimization going on I could make 5 different assignments of the individual numbers and make several different calculations in different lines. If I know there's no optimization at all I may assume the different assignments will increase the load (by requiring more back and forth copying of variables into memory). e.g. a compiler in C using an aggressive optimization flag could leave the programmer free from caring about such basic optimization tricks (because the compiler will do such basic work for him at compilation time).

    edit: For addons, not /run

  2. #2
    Deleted
    It's all loaded on load. Everything that happens later is a function, and thus is already converted to Lua instructions when defined.

    As far as I'm aware, there's no optimization. Try to minimize especially table usage (recycle temporary tables using table.wipe). Example:
    Code:
    local tempTable = {}
    function printSortedStuff()
        for i=1, NumOfStuff() do
            tinsert(tempTable, GetStuff(i))
        end
        table.sort(tempTable)
        for n, v in ipairs(tempTable) do
            print(n,v)
        end
        table.wipe(tempTable)
    end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •