Re: 10% drop in code line count in PG 17

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 10% drop in code line count in PG 17
Date: 2025-11-19 20:21:33
Message-ID: 1646642.1763583693@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> While working on a talk, I studied the number of code line changes in
> each major release, and found PG 17 surprisingly reduced code line count
> by 10%. To get the code line count, I used /pgtop/src/tools/codelines,
> which runs:

> find . -name '*.[chyl]' | xargs cat| wc -l

> Any ideas on the cause of this decrease?

My first thought was that it had to do with the conversion of
src/backend/nodes/ to be largely auto-generated code. If you
are using codelines against just what is in git, that would look
like a decrease. However, I see that came in during v16 not v17,
so that's not the explanation. I'm betting it's some similar
effect though: code getting moved out of the set of files that
will match '*.[chyl]'.

Also ... are you in fact counting only what is in git? Because
I get different answers:

$ git clean -dfxq
$ git checkout REL_17_0
HEAD is now at d7ec59a63d7 Stamp 17.0.
$ src/tools/codelines
1664472
$ git checkout REL_16_0
HEAD is now at c372fbbd8e9 Doc: fix release date in release-16.sgml.
$ src/tools/codelines
1595197

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2025-11-19 20:34:55 Re: 10% drop in code line count in PG 17
Previous Message Sami Imseih 2025-11-19 20:10:42 Re: [Proposal] Adding callback support for custom statistics kinds