Hi all --
[ #() isEmpty ifTrue: ['hallo'] ifFalse: ['squeak'] ] bench '127,000,000 per second. 7.85 nanoseconds per run. 0 % GC time.' [ #() ifEmpty: ['hallo'] ifNotEmpty: ['squeak'] ] bench 7,580,000 per second. 132 nanoseconds per run. 78.0088 % GC time.'
Why is that? :-) Why is there an extra GC?
Here is the current implementation of #ifEmpty:ifNotEmpty:
ifEmpty: emptyBlock ifNotEmpty: notEmptyBlock self isEmpty ifTrue: [^ emptyBlock value]. ^ notEmptyBlock cull: self
Best, Marcel