develooper Front page | perl.perl5.porters | Postings from June 2007

Re: refactor dump.c ( de-warnock attempt )

Thread Previous | Thread Next
From:
Jim Cromie
Date:
June 11, 2007 17:46
Subject:
Re: refactor dump.c ( de-warnock attempt )
Message ID:
466DECEC.6000208@gmail.com
Steve Peters wrote:
> On Wed, Feb 21, 2007 at 10:35:53PM -0700, Jim Cromie wrote:
>> dump.c has a large swath of code in op_dump which has been cut-pasted,
>> 756..956 and 2549..  with the former differing by the addition
>> and subsequent use of an intermediate var;
>>
>>     const OPCODE optype = o->op_type;
>>
>> this 3 patch set refactors that code, then calls it
>>
>> - adds t/run/debugging.t - with 1 test of op-dump
>> - refactor Perl_do_op_dump - somewhat ideosyncratic to lower diffsize
>> - reuse refactoring in Perl_do_op_xmldump
> 
> I've got a few comments about the attached code.  First, I'll give the 
> test a run in a bit, and if it seems OK, I may add it regardless of the 
> other changes.
> 

I guess my corollary of the dilemma (see wikipidia) is between :
5	- No one cares about the post, for whatever reason.
other	- round tuits are too rare to use on boring/tedious patches
cc	- adding 1 cc lets everyone else off the hook (oops)
	- this is its own sub-dilemma


The last resend was 5/11, Ive updated several since then, which Im 
attaching.  The un-resent ones still work, maybe with fuzz,

Heres the synopsis again (in order)

diff.dump-test		- adds debugging.t, only for -DEBUG builds
diff.dump-refactor	- chop long func into 1 + 2 helpers
diff.dump-reduce	- reuse helpers
diff.dump-one-opmad	- push ifdef down into function body
diff.dump-reindent	- cosmetic
diff.dump-chgsig	- chg helpers to share and mod single tmpsv
diff.dump-embed		- disagree, but not enough..

blead + diff.dump-const	- baseline under this series

passes all tests when built with -Dmad and -DDEBUGGING,
producing these sizes: (non-changes elided)

[jimc@harpo dev]$ size dumpM-?/dump.o
    text    data     bss     dec     hex filename
  117932       0       0  117932   1ccac dumpM-0/dump.o
  118106       0       0  118106   1cd5a dumpM-2/dump.o
  114737       0       0  114737   1c031 dumpM-3/dump.o
  114277       0       0  114277   1be65 dumpM-6/dump.o

ie a 3% obj shrink ( in an admittedly uncommon build, but hey, its about 
less code )

[jimc@harpo dev]$ wc -l dumpI-?/dump.c
   2922 dumpI-0/dump.c
   2922 dumpI-1/dump.c
   2968 dumpI-2/dump.c
   2782 dumpI-3/dump.c
   2779 dumpI-4/dump.c
   2777 dumpI-5/dump.c
   2768 dumpI-6/dump.c
   2768 dumpI-7/dump.c


have the appropriate amt of fun ;-)
-jimc

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About