( Smalltalk/X, , - , ):
"foo" "foo:" - noops (.. a ^ self):
self foo ... 3.2 ns
self perform:
[self foo] value ... 12.5 ns (2 sends and 2 contexts)
[ ] value ... 3.1 ns (empty block)
Compiler valuate:('TestClass foo') ... 1.15 ms
self foo:123 ... 3.3 ns
self perform:
[self foo:123] value ... 15 ns (2 sends and 2 contexts)
[self foo:arg] value:123 ... 23 ns (2 sends and 2 contexts)
Compiler valuate:('TestClass foo:123') ... 1.16 ms
":" ":"; - , (-), ( ) , , . IDE fileIn ; , ..
, eval - , , .
Dell Vostro; , .
, ;
, 10 , OS/// . , .
( Repeat-arg ):
callFoo2
|t1 t2|
t1 :=
TimeDuration toRun:[
100000000 timesRepeat:[]
].
t2 :=
TimeDuration toRun:[
100000000 timesRepeat:[self foo:123]
].
Transcript showCR:t2-t1
EDIT:
PS: : IDE (.. -). ( stc-), , (20-30%) - - .
EDIT: , (8ns , 9ns ). -, ( ) - .