develooper Front page | perl.perl5.porters | Postings from September 2012

RE: Changing the Perl error message when a module is not found

Thread Previous | Thread Next
From:
bulk 88
Date:
September 19, 2012 21:05
Subject:
RE: Changing the Perl error message when a module is not found
Message ID:
COL115-W20D02FCA08D88CCF6D4394DF9A0@phx.gbl


> From: vadim.konovalov@alcatel-lucent.com
> To: demerphq@gmail.com
> CC: pagaltzis@gmx.de; perl5-porters@perl.org
> Date: Wed, 19 Sep 2012 13:24:33 +0200
> Subject: RE: Changing the Perl error message when a module is not found
>
> > From: Konovalov, Vadim
> > > From: demerphq
>
> > > Given your concerns we eagerly anticipate the patch that strips the
> > > "Can't locate" out of those strings in a nice sane way.
> >
> > stripping just "Can't locate" will save approx 60+ bytes with
> > a cost of adding complexity, so it hardly worth it.
.......................................
> I replaced these with one single following string:
>
> Can't coerce %s%s to %s%s%s
>
> with a simple change that is attached.
> (test passes correctly)
>
> For not very well understood by me reasons, perl517.dll became a
> bit larger, not smaller,
> it became 974,927 bytes instead of 974,922 bytes without my patch.

I have found that often trying to save space by using format string templates is self defeating for most strings and costs more image space than you think you are saving.

I have 4 long interconnected topics I need to bring up

- OP_DESC macro has a expansion bloat problem
- does a wrapper function need to be written for callers of OP_DESC?
- disabling C literal string alignment using Perl to expand C macros/generate C code, saves 1-8 bytes per string literal in RO image section on 32 bit X86, and separately, if possible, from 5 to 2 bytes of 32/64 x86 machine code in a function where a series of gotos can be written to 1 label that has a noreturn function (aka croak) (very common), or a series of gotos to 1 label that has a warn function (unlikely). The whole string aligner/compact string selector system can easily be disabled by redefining C macros for non-compatible platforms. I have a working example of both of these size reductions in a XS module that compiled and ran without side effects on x86 32/64 VC and Mingw Win32 Perls (4 permutations). I know Perl runs on many more platforms than those 4, so the idea might be a non-starter. This is a summary, not an exhaustive list of all the pros and cons I already know of.
-include examples of x86 machine code of why you generically got a larger image when you "saved a string" by consolidating format strings and how to visualize the break even point for format strings on X86

I'm not sure how to organize my 4 topics.  So, what should I discuss in this thread? and what should I file new tickets for? and should I describe in detail with C examples of the disabling string literal alignment to save image space for warn/croak messages idea or is it a non-starter?
 		 	   		  
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