lua-users home
lua-l archive

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


On Thu, May 16, 2013 at 12:30:23PM +0800, Dong Feng wrote:
> Is there a keyword I could search in the mailing archive, to learn
> more about the related discussion?
> 
> By the way, is it really so expensive that we have to avoid a
> lua_checkstack() ? In this case, the call to lua_checkstack can be
> made before GCTM(), outside the loop, to decrease the overhead of the
> check. Is there justification to prefer an implicate assumption over
> an explicit gurantee?
> 

It's not the cost of the function call so much as the cost of a conditional
branch. The Lua VM very judicially uses similar tricks elsewhere to minimize
conditional branching because it's one of the biggest--if not the
biggest--cost factor with VMs on modern processors.