lua-users home
lua-l archive

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


It was thus said that the Great Enrico Colombini once stated:
> On 10-May-15 02:53, Sean Conner wrote:
> >   Just on a lark, I wrote two programs, one in pure Lua; the other one 
> >   pure
> >C.  The programs calculate the Mandelbrot set (but don't output 
> >anything---I
> >wanted just the pure calculations) [2].  Here are some timings:
> >
> >	Lua in PUC-Lua:	52.7s
> >	C:               2.7s (compiled with -O3)
> >	Lua in LuaJIT:   2.5s
> 
> Sean, out of curiosity, did you also measure with -Os?

  Not intially.  Let's see ... compile compile compile run run run and wow! 
2.2s.

> I am asking this because, in a different context (a small 
> microcontroller) I saw code emitted with -O3 that was slower than using 
> -Os, despite 's' meaning 'size' and not 'speed'. It did strange things, 
> such as jumping to a common piece of code (and back) from the middle of 
> the part I was trying to optimize.

  All this was done on a 32-bit 2.6GHz Penium 4.  Your milage may vary on
other systems.

  -spc