[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Floating point performance (was Re: compiling LUA for uClinux)
- From: "Adam D. Moss" <adam@...>
- Date: Wed, 06 Apr 2005 12:19:10 +0100
Luiz Henrique de Figueiredo wrote:
Just FYI, converting from float to int is more expensive on an x86 machine
than many people realize, if you're using casts to convert.
Since 5.0, Lua can be configured to use a fast conversion method.
Lua 5.1 even tries to do this automatically.
That's neat, I hadn't noticed.
On a similar note, poking around in luaconf.h I tried turning
lua_number2str()'s sprintf() into a gcvt() to see if that
gained anything. But it was actually slightly slower than
sprintf() (which was a bit surprising because intuitively sprintf
has to do more work, but sprintf has probably been subject to more
Adam D. Moss - email@example.com