lua-users home
lua-l archive

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

On Tue, Oct 18, 2011 at 12:20 PM, Luiz Henrique de Figueiredo <> wrote:
> I thought this would be faster than the original solution but i get no
> noticeable speedup

As soon as your C functions do some real work, the overhead of the C API
becomes unnoticeable.

well my problem is that I'm trying to rewrite some parts of my c++ code to lua and the c++ part that I use is (almost) identical to the original

what my lua code did was roughly to break the original c++ into pieces and calling a c function for each piece. this was somewhere around 16 times slower than the original

since i almost only do c++ calls from lua I figured this was the main part that took time (the calling that is) and tried to minimize this by not changing between lua and c++ more than necessary and thought this would help and was really surprised when it didn't