Re: REGRESS_OPTS versus MSVC build scripts

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: REGRESS_OPTS versus MSVC build scripts
Date: 2009-08-19 15:43:50
Message-ID: f67928030908190843m1e7f3bc9m48f4a698721f970e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> ---------- Forwarded message ----------
> From: David Fetter <david(at)fetter(dot)org>
> To: Andrew Dunstan <andrew(at)dunslane(dot)net>
> Date: Tue, 18 Aug 2009 11:31:41 -0700
> Subject: Re: REGRESS_OPTS versus MSVC build scripts
> On Tue, Aug 18, 2009 at 02:15:48PM -0400, Andrew Dunstan wrote:
>>
>>
>> Andrew Dunstan wrote:
>>>
>>
>> Here's an untested patch ... I think it should do the job, however, at
>> least for contrib modules, which is the immediate problem.
>>
>> cheers
>>
>> andrew
>>
>>
>
>> Index: src/tools/msvc/vcregress.pl
>> ===================================================================
>> RCS file: /cvsroot/pgsql/src/tools/msvc/vcregress.pl,v
>> retrieving revision 1.10
>> diff -c -r1.10 vcregress.pl
>> *** src/tools/msvc/vcregress.pl 1 Dec 2008 13:39:45 -0000 1.10
>> --- src/tools/msvc/vcregress.pl 18 Aug 2009 18:12:59 -0000
...
>> *** 198,203 ****
>> --- 199,223 ----
>> exit $mstat if $mstat;
>> }
>>
>> + sub fetchRegressOpts
>> + {
>> + my $handle;
>> + open($handle,"<Makefile")
>
> This section is probably better done with Tie::File.

No, absolutely not. I would have a hard time believing any computer
that would be
compiling or testing pg would not have enough memory to slurp a
Makefile into memory.
And if it did, Tie::File would not be the answer. For files with
small line lengths the
memory overhead of Tie::File is generally more than the memory savings.
And it gives us the added bonus of letting us accidentally change
files, when we
thought we were just changing an in memory copy.

The real solution in that highly unlikely case would be to read the
file line by line in
a loop, rather than slurping it, as the existing code doesn't search
across line
boundaries anyway.

Cheers,

Jeff

Browse pgsql-hackers by date

  From Date Subject
Next Message Shivesh Wangrungvichaisri 2009-08-19 15:50:44 BUG #4996: postgres.exe memory consumption keeps going up
Previous Message Joe Conway 2009-08-19 15:38:38 Re: FDW-based dblink (WIP)