#cull:... uses the same primitive as #value:..., so unless the primitive fails because the block has fewer arguments, we still take the fastest lane possible.
Empirical proof: :-)
block := [:a :b :c :d :e | a ** b ** c].
{[block value: 17 value: 42 value: 6 value: 4 value: 3] bench. "#('550,000 per second. 1.82 microseconds per run. 2.25955 % GC time.'"
[block cull: 17 cull: 42 cull: 6 cull: 4 cull: 3] bench}. "'551,000 per second. 1.82 microseconds per run. 1.9996 % GC time.')"
Resolves https://github.com/hpi-swa/MessageSendRecorder/pull/8#issuecomment-789111607. Regarding the performance questions raised in this thread: When users pass a block with the maximum number of arguments (4 resp. 5), the performance is not affected. There are two arguments for this:
#cull:...
uses the same primitive as #value:..., so unless the primitive fails because the block has fewer arguments, we still take the fastest lane possible.Empirical proof: :-)
Depends on Kernel-ct.1376 (inbox).