lua-users home
lua-l archive

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


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?

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.

(disclaimer: I did not check if the code in its entirety was actually faster, because I was interested in squeezing the last clock cycle out of a particular section)

--
  Enrico