lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'll add examples sometine.

I have not properly taken benchmarks, but here is a good example for function inlininig:

```
local function pow(i)
return i * i
end
local a = {}
for i = 1, 10000000 do
a[i] = pow(i)
end
```

compiling it and optimize:
```
$ luac foo.lua
$ opeth luac.out -VT
$ lua optimized.out
```

In my local it shows x1.4 speedup.


On Sat, Jan 14, 2017 at 2:14 AM, Joseph Manning <manning@cs.ucc.ie> wrote:
On 2017-Jan-13 (Fri) at 18:29 (+0900), Satoru Kawahara wrote:

>> I released the optimizer for Lua 5.3 VM Bytecode.
>>
>> https://github.com/Nymphium/opeth
>>
>> It can optimize by following techniques
>> - constant folding
>> - constant propagation
>> - function inlining (experimental)
>> - dead-code elimination
>> - unreachable block removal
>> - unused resources removal
>>
>> [ - - - ]
>>
>> --
>> Kawahara Satoru
>> College of Information Science
>> University of Tsukuba

Satoru,

   This looks interesting and useful, thanks for sharing it with us.

   Do you have any examples / benchmarks to show the run-time effect
   of these optimisations?

Joseph

------------------------------------------------------------------------
Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie
------------------------------------------------------------------------




--
Kawahara Satoru
College of Information Science
University of Tsukuba