Re: Removed unused import modules from tap tests

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: Removed unused import modules from tap tests
Дата
Msg-id 87zgqcow53.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: Removed unused import modules from tap tests  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Daniel Gustafsson <daniel@yesql.se> writes:
>>> On 10 Nov 2021, at 13:37, Alvaro Herrera <alvherre@alvh.no-ip.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Frontend error logging style
Следующее
От: Andrey Borodin
Дата:
Сообщение: Re: Commitfest 2021-11 Patch Triage - Part 2