Nathanael,
I have anticipated your answer and also prepared my reaction:
Nathanael Schärli wrote:
Stephan,
Wow, a speedup of factor 5 or more sounds fabulous! I haven't written the primitive yet, but considering the great speedup we should definitely do it. The main problem of Genie (especially on PDAs) is the performance and using such a primitive we could probably solve that.
I have quite some C/C++ experience but I've never written Squeak primitives yet and I would appreciate your help!
I'm motivated to help here, since your work seems to be very good and many people are interested in it. Fortunately I have some experience with writing Squeak primitives (LargeIntegersPlugin).
But since I'm very busy and don't want to take a deeper look onto your Genie work right now (possibly after having BlockClosure semantics ;-) ), I need your help.
If you send me a changeset containing - a semantic testing method which tests CRStrokeFeature>>sameClassAbsoluteStrokeDistance:forReference: with a few typical examples; and - a speed testing method, which checks for the speed of just this method *after* the parameter constructing stuff has been done ('self' seen as a parameter, too!); then I'll write you the prim.
This means to create some typical instances of CRStrokeFeature first and calling >>sameClassAbsoluteStrokeDistance:forReference: for each from the testing method then:. Semantic testing additionally compares each result with the wished one, speed testing not.
Greetings,
Stephan
Nathanael
As far as the delay in the lookup is concerned, I'm really
thinking of
writing a primitive for it. 90% of the time is spent in the method CRStrokeFeature>>sameClassAbsoluteStrokeDistance:forReference: that basically iterates over the vector decompositions of two
gestures and
compares them using integer arithmetic. (I avoided any
floating point
operations because that is even slower on small machines).
This method has <
100 LOC and it only calls two helper methods (3 LOC each).
I don't have much
experience concerning the performance gain by making a
primitive out of such
a method, but I have a feeling that it could be quite a lot. Does anyone know more?
After taking a look onto it I guess a speedup of factor 5 to 10 for this method, if written as primitive. This is a conservative estimation.
If you or another person haven't written it so far, I'd like to help here.
Greetings,
Stephan
squeak-dev@lists.squeakfoundation.org