ko1 / atdot.net wrote:
> I haven't dig details, but maybe it is because of GC perforamance.
> Because Proc (and Env) objects are wb-unprotected, such objects are
> marked on every minor GC.

Right, perf says lots of calloc/free.

Micro-optimization:

I wonder if calloc/ZALLOC costs for zero-ing small objects in
TypedData_Make_Struct ends up being measurable sometimes.
We often overwrite most of the object immediately in the case of
rb_proc_t.

> This problem is not critical because MRI is not for lambda calculus :p
> but we can improve about it.

More micro-optimization:

I notice a lot of YARV mark/free functions do:

	if (ptr) { ... }

(e.g. proc_mark/proc_free)
Maybe tiny branching + icache overheads add up for common cases where
data->ptr is always valid.  I'll see if it's measurable once I figure
out Bug #10206.