#3 Speed up parsing by caching the Nonterminal hash

closed-accepted
nobody
None
5
2005-10-19
2004-04-01
Matt MacMahon
No

I've been playing with nltk for a good sized grammar.
Calculating the hash for the Nonterminal class was
showing up on profiles. Since Nonterminals are
constant, we can cache the hash and get a noticable
speedup, especially for deep parses. I haven't
measured it in 1.3, but it was seconds off long parses
in 1.2.

Discussion

  • Matt MacMahon
    Matt MacMahon
    2004-04-01

    Diff file

     
    Attachments
  • Steven Bird
    Steven Bird
    2005-10-19

    • status: open --> closed-accepted
     
  • Steven Bird
    Steven Bird
    2005-10-19

    Logged In: YES
    user_id=195736

    Adopted in nltk-lite