Well, I finally did it. Ported the code from Python to Boo. It wasn't just the code, but I had to port data I had stored in a shelve (I basically extracted the data from the files again, and then serialized it to a file -- a fake shelve).
Some interesting results from the tests (the numbers are for ten runs against each fxn):
SpellCheckText: 00:05:32.54 OR 332.54 seconds
SpellCheckTextUsingCache: 00:05:20.65 OR 320.65 seconds
OptimizedSpellCheckTextUsingCache: 00:01:02.44 OR 62.44 seconds
UglyOptimizedSpellCheckTextUsingCache: 00:01:02.56 OR 62.56 seconds
For the original fxn, one spell check of was 33.25 seconds long. For the cache, it was 32. The optimized was 6.25 as well as Ugly Optimized.
I should mention that these results are against the PORTs of Python to Boo. The python code had optimizations that were python specific. Boo being static and not dynamic will have different optimizations. So when I spend time on actual optimization -- that will be more fair. Although I confess to being surprised that Boo was between 3 and 2 times slower!
Heres the code:
I'm having stupid indentation problems w/ Blogger again.. so code is not up. :-(
Thursday, February 24, 2005
Boo Port of Spell Checking Code.
Posted by Torial at 12:20 AM Labels: Boo, Programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment