bug-gperf
[Top][All Lists]
Advanced

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

Re: Performance improvement for large keysets


From: Pavel P
Subject: Re: Performance improvement for large keysets
Date: Thu, 30 Jan 2020 05:48:24 +0600



On Wed, 29 Jan 2020 at 22:12, Bruno Haible <address@hidden> wrote:
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 
 

reply via email to

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