lua-users home
lua-l archive

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

On Thu, Sep 28, 2006 at 02:07:06PM -0500, Rici Lake wrote:
> >But there is a way to speed up Lua->C function calls:
> Interesting ideas. But I think the best way of speeding up the Lua->C 
> interface is to call it less often; i.e. design higher-level 
> interfaces.

I want (hypothetically) to implement an inner-loop character count
function for UTF-8 (like strlen, but returns the number of whole
characters).  It's inner-loop, so I can't have all that horrible
function call overhead.  Can you suggest the higher-level interface
that you have in mind that would solve this?  (Without hardcoding
anything specific to my narrow purpose into the Lua core, of course.)

Any of Mike's approaches seem to solve this.

> The optimizations you mention seem to apply to the math library only 
> (nowhere else would prototypes which only involve lua_Numbers be 
> common), but I can see that speeding up the math library would be a 

He only gave examples using lua_Numbers; it would also, presumably,
support strings.

Glenn Maynard