bug-gperf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Performance improvement for large keysets


From: Pavel P
Subject: Performance improvement for large keysets
Date: Wed, 29 Jan 2020 17:34:02 +0600

I have a very similar experience as mentioned in "Multi-threaded search for large key sets" thread:
https://lists.gnu.org/archive/html/bug-gperf/2020-01/msg00000.html 

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 
 Search::compute_partition iterates entire list of available partitions. This change updates compute_partition to keeps track of partitions by their size to avoid iterating partitions with sizes that do not match required undetermined_chars_length.
This change results in roughly 35% run-time speedup with 5000 keys (key lengths are 1 to 10 chars).
This change uses std::vector, if you prefer not to introduce std c++ containers, then you may take follow up change to use basic c++ code:
https://github.com/pps83/gperf/commit/f967d3c1f63902e022dac586d646824d91ff21b7  

Thanks,
Pavel
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]