On Mar-17, Benjamin Goldberg wrote:
> 
> The answer to this question varies from platform to platform, and I've
> only go windows to test on...
> 
> If I do 32 "save"s in a row, this will certainly be slower than doing a
> single "push".
> 
> If I do 1 "save", this will (hopefully) be faster than 1 "push".
> 
> How many "save"s does it take to be to be slower than one "push"?
> 
> (When writing pasm by hand, what's a reasonable cutoff?)

I would guess that about 256 million saves is the same as 8 million
pushes, but that really depends on how much space an entry on the
respective stacks take and how large your virtual address space can be
-- because the only way to make them equivalent is to call enough of
them to run out of memory and crash. :-)

Sorry, I'm being obnoxious. You fell into the same trap as I recently
did. pushx and save are not interchangeable; they operate on
completely different stacks. 'save' pushes an entry of arbitrary type
onto the user stack; pushi, pushs, and friends push onto type-specific
register frame stacks.

Somehow, this needs to be documented better, because it's quite
surprising (to me, at least.)

Reply via email to