aCompiledMethod>>#= puzzle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

aCompiledMethod>>#= puzzle

Klaus D. Witzel
This is a puzzle. I will donate EUR 50 to the Squeak project  
( http://www.squeak.org/Donate/ ) if you post a satisfying answer here in  
squeak-dev.

Input: any two instances of CompiledMethod and a series of questions and  
answers. You can ask other / more questions, except a question like "is  
<this> the answer" where <this> means your guess.

Q1: do the 2 methods have equivalent header?
A: no

Q2: do the 2 have same bytecode size?
A: no

Q3: do the 2 have the same literals?
A: yes

Q4: do the 2 send different messages?
A: no

Q5: do the 2 send messages to diffent temps or instVars or other?
A: no

Q6: given any input, do the 2 return the same result?
A: yes

Q7: given any input, do the 2 perform the same sequence of message sends?
A: yes

Q8: does the one with *more* bytecodes run faster?
A: yes

So the 2 differ in bytecodes and performance.

Q: what's the name of the *longer*, in terms of bytecodes, method? With  
name it is meant, under what name is the method known in the field (in the  
public).

A: your solution to the puzzle

/Klaus