Using malloc/free as in cc0851de980d46e85e514657d8d9a484fe8be2eb is certainly much faster than the old worst case behavior. I would guess the new block allocator is faster than malloc/free, so I propose to overwrite cc0851de980d46e85e514657d8d9a484fe8be2eb by this. Any objections?
To clarify somewhat: No, I do not really object. It's just that I do not entirely see the need for returning the small amount of memory represented by pike-frames to the system, and allocating new ones while running. :)
Anyway, it's not entirely accidental that there is now a Binary Tree testcase in the performance testsuite, although that one also tests the fact that it is rather slow to creata a clone of a class from itself.
That is:
class Tree { Tree left, right; create() { left = Tree(); right = Tree() } }
is slower than
class Tree { Tree left, right; create() { left = this_program(); right = this_program(); } }
which is significantly slower than
class Tree { Tree left, right; }
void create_tree() { Tree x = res; x->left = Tree(); x->right = Tree(); }