Hi Pavel,
> When gperf was way too slow for me to wait, I took a quick look with
> profiler and made a simple optimization in Search::compute_partition to
> avoid scanning all possible partitions and to consider only those with
> matching size.
>
> Please consider taking the change:
> https://github.com/pps83/gperf/commit/5da97d6ac156f1fdb7967a9f45654c15ab9b4e83
> ...
> This change results in roughly 35% run-time speedup with 5000 keys (key
> lengths are 1 to 10 chars).
Probably it can be optimized even more, by using a hash table in this place
(mapping an undetermined_chars array to the list of keywords that have this
same undetermined_chars array)...
This will heavily depend on hash table implementation, as building and updating it might be more expensive. I did try to use std::unordered_set and it was too slow