Re: [PATCHv2 2/3] hvsupport: construct the group regex upfront

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

 



On Tue, Jul 19, 2016 at 18:55:53 +0200, Ján Tomko wrote:
> The %groups hash contains all the driver types (e.g.
> virHypervisorDriver or virSecretDriver).
> 
> When searching for all the APIs that are implemented by a driver
> of that specific driver type, we keep iterating over the %groups
> hash on every line we look at, then matching against the driver type.
> 
> This is inefficient because it prevents perl from caching the regex
> and it executes the regex once for every driver type, even though
> one regex matching excludes all the others, since all the driver types
> are different.
> 
> Construct the regex containing all the driver types upfront to save
> about 6.4s (~98%) of the script execution time.
> ---
>  docs/hvsupport.pl | 33 ++++++++++++++++-----------------
>  1 file changed, 16 insertions(+), 17 deletions(-)

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]