Re: Large C files - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Large C files
Date
Msg-id CA+U5nMK9PEU5vwvAb0vYLdmKVNcq27LTOem6mdeOxaq3WFoikQ@mail.gmail.com
Whole thread Raw
In response to Re: Large C files  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Large C files
List pgsql-hackers
On Tue, Sep 6, 2011 at 3:05 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Peter Eisentraut wrote:
>> On l?r, 2011-09-03 at 19:18 -0400, Bruce Momjian wrote:
>> > FYI, here are all the C files with over 6k lines:
>> >
>> > -  45133 ./interfaces/ecpg/preproc/preproc.c
>> > -  33651 ./backend/parser/gram.c
>> > -  17551 ./backend/parser/scan.c
>> >    14209 ./bin/pg_dump/pg_dump.c
>> >    10590 ./backend/access/transam/xlog.c
>> >     9764 ./backend/commands/tablecmds.c
>> >     8681 ./backend/utils/misc/guc.c
>> > -   7667 ./bin/psql/psqlscan.c
>> >     7213 ./backend/utils/adt/ruleutils.c
>> >     6814 ./backend/utils/adt/selfuncs.c
>> >     6176 ./backend/utils/adt/numeric.c
>> >     6030 ./pl/plpgsql/src/pl_exec.c
>> >
>> > I have dash-marked the files that are computer-generated.  It seems
>> > pg_dump.c and xlog.c should be split into smaller C files.
>>
>> I was thinking about splitting up plpython.c, but it's not even on that
>> list. ;-)
>
> For me, the test is when I feel, "Yuck, I am in that massive file
> again".

There are many things to do yet in xlog.c, but splitting it into
pieces is pretty low on the list.

I did look at doing it years ago before we started the heavy lifting
for SR/HS but it was too much work and dangerous too.

The only way I would entertain thoughts of major refactoring would be
if comprehensive tests were contributed, so we could verify everything
still works afterwards.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: Redundant bitmap index scans on smallint column
Next
From: Robert Haas
Date:
Subject: Re: Large C files