Setting break points

ducasse ducasse at iam.unibe.ch
Tue Nov 18 08:04:23 UTC 2003


Hi avi

> Presumably modifying the VM, as Andreas did, wasn't one of the options 
> you benchmarked.
> Anyway, running a very simple method 100k times, I see:
>
> Plain method: 61ms
> Object as method: 110ms
> Wrapped method: 1077ms

Sure we are comparing orange and apples there.
If you look at my paper Joop 99, you will see that I compare only 
solutions that are working without having to have another VM.
Else you have no point because you will never be able to modify and 
recompile the one of VW, ST/X, Dolphin

>> I never noticed that the code was that bad. Normally john writes 
>> quite good code.
>
> I didn't say "bad", I said ugly - mostly what I'm thinking of is the 
> need to generate and compile strings of code (look at MwMethodWrapper 
> class>>codeStringFor:).  Given the constraints (not hacking the VM), 
> I'm sure John made the best choices.

Yes because he does require to compile a method to wrap it. So the 
wrapping and unwrapping can work with compiler and it is extremely fast.
I read nearly all the code of method wrapper at that times and I 
learned a lot.
In fact any approach based on method generation has to generate method 
body wrapper. Now the solution of john is the most elegant one
no compilation more than the one of the prototypes (around 6) needed.

What I learn in the process is that 
CompiledMethod>>value:WwithArguments: is an important entry point 
missing in Squeak (even if as Ian reported
at that time you can write everything within Squeak and get the same 
entry).
Now the current value:withArguments: improved since I looked at it 
(before it was a hack). Still it invokes the lookup and I'm not sure 
that this is what we want but this is there.

withArgs: argArray executeMethod: compiledMethod
	"Execute compiledMethod against the receiver and args in argArray"

	| selector |
	<primitive: 188>
	selector _ Symbol new.
	self class addSelector: selector withMethod: compiledMethod.
	^ [self perform: selector withArguments: argArray]
		ensure: [self class removeSelectorSimply: selector]




> Avi
>
>




More information about the Squeak-dev mailing list