[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 01 Feb 2013 15:46:38 -0500
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> Please answer why *Byte-compiled code uses much less stack space*?
Simple because every `progn' or `if' nesting adds to the stack
space usage in interpreted code, but not in byte-compiled code.
Similarly for `let', interpreted code will end up pushing the new
binding on the "specpdl stack" and then doing a recursive C call to the
Feval function, whereas byte-compiled code will only push the new value
onto the "specpdl stack" but will stay within the same function.
> Very briefly, with few tech details. Which ratio between compiled and
> non-compiled usage?
That varies a lot depending on the kind of code.
I'd guess on the average a factor of 4, maybe?
Stefan "Note that there are different notions of stack space at
play here, such as the one measured by
max-lisp-eval-depth, the one measuring the size of the
C stack, the once measured by max-specpdl-size, ..."
- Re: max-lisp-eval-depth,
Stefan Monnier <=