Go to: Intranet Home Page
  Dashboard > Spelling Tool > Browse Space > News from
  Spelling Tool
  News from Oct 18, 2005
Log In   View a printable version of the current page.  
 

  2005/10/18
Memoization Didn't Help

Spent 2-3 hours today trying to speed up parsing with memoization. Got the syllable lexer memoized. It was actually slower.

The word parser/divider isn't done in a functional style, so I found it hard to memoize. It might stand to gain more, since it has more Python loops, etc., but it started looking like a time pit, so I quit. I left the code in there: Syllables.Word._FastSplitRest(), but I made sure compile() never calls it. Might come back to it later, but I doubt it, unless speed really becomes an issue.

It still bugs me, though: I know we are parsing some of the same tails over, and over, and over. But at this point, it's waste a few cycles, or waste a lot of hours.

If this becomes an issue, it'd be wise to profile first, I think. I was really sure the syllable lexer would be easy to memoize, and it was. I was really sure it would give me 10x the speed, but it did the opposite. Python can be that way, I've heard: your gut (your c and asm?) instinct about what's fast and what's not isn't always right.

Posted at 18 Oct @ 12:22 PM by Brad Olson | 0 Comments

  October 2005
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Oct 19, 2005
Oct 14, 2005

Powered by a free Atlassian Confluence Open Source Project / Non-profit License granted to Canadian Bible Society. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators