[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unprepared Stack Top Increase
- From: William Ahern <william@...>
- Date: Wed, 15 May 2013 23:13:38 -0700
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.