jtauber / pyuca

a Python implementation of the Unicode Collation Algorithm
MIT License
216 stars 23 forks source link

Can you speed up sort_key in pyuca? #8

Open ChameleonRed opened 9 years ago

ChameleonRed commented 9 years ago

I have tested collator itself and it takes some time to sort 3000 items - I want use pyuca in interactive application/web:

raw_keyword_idea.py:35() -> 3332 0.010 1.048 collator.py:102(sort_key)

                                          1    0.008    1.061  {sorted}

collator.py:102(sort_key) -> 3332 0.267 0.744 collator.py:57(collation_elements)

                                       3332    0.237    0.291  collator.py:88(sort_key_from_collation_elements)

                                       3332    0.003    0.003  {unicodedata.normalize}