JMK no matter what

PyCon #3

Mighty Dictionary; basically it's Data Structures 101

  • Hash lookup times are not dominated by probing -- where the max number of probe can grow up to 16 instead of 1, the total time never grows 2x
  • do not insert elements during iteration!!!!! => 이건 내가 STL rbtree 에 익숙해서 걸려넘어지기 쉬운 주제인듯
    • if you need more space, consider giving classes slots http://mypythonnotes.wordpress.com/2008/09/04/slots/
    • 9.0 and 9 and complex(9, 0) actually have same hashes! interesting
  • dict actually shrinks itself only when 2/3 full (with dummy keys), no way to force it to resize
2010-02-20 05:38:39 | JM | /after/conferences/ | 0 Comments

Leave a comment