[libvirt] [PATCH 22/22] build-aux:check-spacing: Remove arguments of subroutines for speed

Ján Tomko jtomko at redhat.com
Fri Oct 5 09:49:51 UTC 2018


On Fri, Oct 05, 2018 at 09:26:22AM +0100, Daniel P. Berrangé wrote:
>On Fri, Oct 05, 2018 at 04:11:45PM +0800, Shi Lei wrote:
>> This patch replaces those 'my varname;' with 'our varname;', i.e.
>> it uses global var, rather than passing arguments to subroutine.
>> So it can be a bit faster.
>
>NACK
>
>Use of global variables like this is harmful to maintenance of
>the code.
>

Also, it does not really speed up the script.

Given that most of the slowdown happened by separating the code into
subroutines, I suspect that the regexes are no longer cached.

Jano

>Regards,
>Daniel
>-- 
>|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
>|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
>|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20181005/0d05414c/attachment-0001.sig>


More information about the libvir-list mailing list