lua-users home
lua-l archive

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


On Apr 04, 1997 at 09:43:56AM -0300, Roberto Ierusalimschy wrote:
> >   a slowdown by a factor of almost 4 :
> 
>   We have detected a "performance bug" in v3.0a which might be responsible
[...] 
> 
> void luaL_arg_check(int cond, int numarg, char *extramsg)
> {
>   if (!cond) {
>     char *funcname;
>     lua_getobjname(lua_stackedfunction(0), &funcname);
>     if (funcname == NULL)
>       funcname = "???";
>     if (extramsg == NULL)
>       luaL_verror("bad argument #%d to function `%s'", numarg, funcname);
>     else
>       luaL_verror("bad argument #%d to function `%s' (%s)",
>                       numarg, funcname, extramsg);
>   }
> }
> 
> (that is, with the call to lua_getobjname inside the "if"). Please try that.
> 
> 
> -- Roberto
> 

    I modified the source as indicated, and got

    loj > time lua3 htmlp.lua < chap18.html > tt.tex
    3.19user 0.06system 0:03.33elapsed 97%CPU

    which is not bad for an alpha version (only ~20% slower than lua2.5)

    Thanks,

       Veijo

-- 
 Veijo Vilva                        vilva@xiron.pc.helsinki.fi
 Dept. Animal Science               http://xiron.pc.helsinki.fi/people/vilva
 P.O.Box 28                         PGP public key available on ./vvpgp.html
 FIN-00014 University of Helsinki   Tel. +358 9 708 5584