Re: Removed unused import modules from tap tests

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Removed unused import modules from tap tests
Date: 2021-11-10 15:42:00
Message-ID: 87zgqcow53.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>>> On 10 Nov 2021, at 13:37, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>>> ..but I wonder what's the *benefit* of removing those includes. IOW, what's
>>> the reason not to simply drop the patch?
>
>> I think the value is mostly neatnikism, the actual effect on runtime is
>> unlikely to be measureable. I won't argue against doing it, but I suspect
>> we'll just slowly add a lot of these back as tests evolve making excercise
>> less useful.
>
> Yeah, that last was pretty much my reaction. I don't know enough about
> Perl to be sure how much an unused import costs, but I suspect you're
> right that it won't be measurable in context, considering that most of
> these test scripts run at least one initdb.

On my laptop (using the "performance" CPU frequency governor to avoid
scaling noise) loading PostgreSQL::Test::Utils takes about 80ms:

$ time perl -I./src/test/perl -e 'use PostgreSQL::Test::Utils;'

real 0m0.079s
user 0m0.078s
sys 0m0.001s

However, if we're also loading PostgreSQL::Test::Cluster, the difference
is negligible, because most of the time is spent loading modules used by
both:

$ time perl -I./src/test/perl -e 'use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils;'

real 0m0.092s
user 0m0.088s
sys 0m0.004s

$ time perl -I./src/test/perl -e 'use PostgreSQL::Test::Cluster;'

real 0m0.090s
user 0m0.081s
sys 0m0.008s

- ilmari

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2021-11-10 15:54:21 Re: Commitfest 2021-11 Patch Triage - Part 2
Previous Message Robert Haas 2021-11-10 15:28:35 Re: Frontend error logging style