develooper Front page | perl.perl5.porters | Postings from February 2004

Re: op_seq (was: Freeing code)

Thread Previous | Thread Next
Rafael Garcia-Suarez
February 21, 2004 09:14
Re: op_seq (was: Freeing code)
Message ID:
Paul Johnson wrote:
> Here's something I've had on my TODO list for slightly over a year.  I
> sent a test patch last year, fishing for comments, but no one bit.  So
> here's the real thing.
> op_seq uses sixteen bits, as does op_type.  op_seq only needs to hold
> three states, and op_type only needs nine bits.  This means that we
> could store all the information we need in eleven bits, save sixteen
> bits per op and still have five bits spare for future use.
> The attached patch does just that.

Thanks, applied as #22353.
I bumped up the version number of the various impacted B:: modules,
due to API changes (no more op_seq method for B::OP.)

> Obviously the reduction in memory usage depends on the proportion of ops
> to other data.
> Notes:
> - perl needs to be run.  In fact, it needs to be run anyway,
>   whether or not this patch is applied.
> - Of course, binary compatibility is completely shot.

It was shot already :)

> - So is Devel::Cover.  I'm not aware of any other CPAN modules which use
>   op_seq, but there probably are some.

One of those days I'll install that grepcpan script.

> - Fake sequence numbers are provided for -Dx output, in a similar
>   fashion to that which Stephen McCamant implemented for B::Concise.
>   The order of the numbers assigned to the ops, and which ops are
>   assigned sequence numbers, results in slightly altered -Dx output.
>   This doesn't seem important to me, but extra work could be put into
>   the dump routines to make the output more similar.  Or some of the
>   complexity could be removed if slightly greater changes were
>   acceptable.
> - I can detect no change in execution speed.
> - perlcc works as well as it did before.
> - 88 of the test.bytecode target tests fail.  This is the same as before.
> - The bytecode still stores op_type in sixteen bits and each of op_opt
>   and op_static in eight bits.  This could obviously be improved.  Does
>   anyone still care about this?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About