britg/MultistrokeGestureRecognizer-iOS — pull request #3 by bengotow (2013-01-27 20:33:09+00:00)
Title: Improved recognition performance

I've refactored WTMGlyphUtilities and WTMGlyphTemplate to perform vector calculations using a C array of floats instead of an NSArray of NSNumbers. I needed the gesture recognizer to match against a large set of templates quickly, and this approach is significantly faster, because calling [NSNumber floatValue] is pretty slow. In my tests on an iPad 1, it can now match against 80 glyphs nearly instantly instead of taking ~1 second.

I've also added an additional method of retrieving the result of the glyph detection—WTMDetectionResult. I wanted to be able to run multiple detection operations on multiple threads at the same time, and returning a result object made it easier to keep things organized. Since the glyph detection happens synchronously, I don't think delegate callbacks are necessary (though I've made them optional and left them there), but they might be nice in the future if the operation becomes async.