|
| 1 | +2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net> |
| 2 | + |
| 3 | + Improve AlphaMap range merging. |
| 4 | + |
| 5 | + * datrie/alpha-map.c (alpha_map_add_range): |
| 6 | + - Also try to merge adjacent ranges. Otherwise, adding one by one |
| 7 | + character will result in linear search on alphabet set. |
| 8 | + |
| 9 | + Thanks Mikhail Korobov <kmike84@gmail.com> for the report. |
| 10 | + |
| 11 | +2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net> |
| 12 | + |
| 13 | + Migrate trie_enumerate() to the new TrieIterator. |
| 14 | + |
| 15 | + This improves performance by 10%, and recursion stacks are also |
| 16 | + eliminated. |
| 17 | + |
| 18 | + * datrie/trie.c (trie_enumerate): |
| 19 | + - Replace da_enumerate() call with TrieIterator loop. |
| 20 | + * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData): |
| 21 | + * datrie/darray.h, datrie/darray.c |
| 22 | + (-da_enumerate, -da_get_transition_key, -DAEnumFunc, |
| 23 | + -da_enumerate_recursive): |
| 24 | + - Drop now-unused codes. |
| 25 | + |
| 26 | +2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net> |
| 27 | + |
| 28 | + Optimize key calculation for TrieIterator. |
| 29 | + |
| 30 | + * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h |
| 31 | + +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c: |
| 32 | + - Add dynamic string classes DString and TrieString. |
| 33 | + * datrie/trie.c: |
| 34 | + - (TrieIterator): Add "key" dynamic trie string member for |
| 35 | + incrementally gathering the key while iterating. |
| 36 | + - Initialize "key" member to NULL on construction. Only allocate and |
| 37 | + free it on branching root states. |
| 38 | + * datrie/darray.h, datrie/darray.c |
| 39 | + (da_first_separate, da_next_separate): |
| 40 | + - Instead of allocating memory for return string, accept a dynamic |
| 41 | + string object and update it while traversing. |
| 42 | + * datrie/trie.c (trie_iterator_next): |
| 43 | + - For branching state, create the "key" dynamic string object on |
| 44 | + first iteration and pass it to da_first_separate() and |
| 45 | + da_next_separate() along the iterations. |
| 46 | + * datrie/trie.c (trie_iterator_get_key): |
| 47 | + - Replace the total key reconstruction by da_get_transition_key() |
| 48 | + with simple string catenation of the dynamic "key" and the suffix |
| 49 | + string. |
| 50 | + * datrie/darray.h, datrie/darray.c (da_get_transition_key): |
| 51 | + - Adjust to use dynamic string instead of total allocation. |
| 52 | + * datrie/darray.c (da_enumerate_recursive): |
| 53 | + - Adjust the da_get_transition_key() call accordingly. |
| 54 | + |
| 55 | + Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach |
| 56 | + and for profiling check. |
| 57 | + |
1 | 58 | 2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
|
2 | 59 |
|
3 | 60 | Add TrieIterator and its operations.
|
|
0 commit comments