[Libosinfo] [PATCH osinfo-db 08/10] tests: test_isoinfo: don't log in match()

Cole Robinson crobinso at redhat.com
Wed Mar 20 14:18:03 UTC 2019


On 3/20/19 4:02 AM, Fabiano Fidêncio wrote:
> On Tue, Mar 19, 2019 at 9:02 PM Cole Robinson <crobinso at redhat.com> wrote:
>>
>> With the full test suite we hammer this function over 100K times.
>> This logging call in fact causes a lot of slow down. Dropping it
>> cuts time for me from ~120s to ~80s
>>
>> Signed-off-by: Cole Robinson <crobinso at redhat.com>
>> ---
>>   tests/test_isoinfo.py | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/tests/test_isoinfo.py b/tests/test_isoinfo.py
>> index 9477942..8440bb2 100644
>> --- a/tests/test_isoinfo.py
>> +++ b/tests/test_isoinfo.py
>> @@ -69,8 +69,6 @@ class _ISODataMedia():
>>           if volumesize == 0:
>>               volumesize = self.volumesize
>>
>> -        logging.warning("media.volumeid: %s | self.volumeid: %s",
>> -                media.volumeid, self.volumeid)
> 
> Ouch, this was a debug log that I forgot to remove. /o\
> 

I was surprised it had such a major impact on the performance, but the 
logging layer has locking so it's transparently thread safe, seems like 
that was holding things up quite a bit

- Cole




More information about the Libosinfo mailing list