[PATCH] debloat lash by 4.803725881571%

Bernhard Fischer rep.nop at aon.at
Tue Jun 20 20:14:24 UTC 2006


On Tue, Jun 20, 2006 at 09:54:40AM -0400, Rob Landley wrote:
>On Monday 19 June 2006 4:37 am, Bernhard Fischer wrote:
>> >Do the ATTRIBUTE_UNUSEDS actually save space, or is this fighting off
>>
>> It is silencing a warning about unused parameters, i.e. it sets
>> TREE_USED for these params to inhibit a warning.
>
>I'm not currently getting this warning.  It sounds like a broken warning.  
>(Unused local variables, sure.  But unused function parameters are often 
>externally imposed.)

It's a warning you can specifically ask for if you feel like. It's a
good warning since it potentially points out useless parameters in our
functions. I don't think that it warns about prototypes stemming from
system-headers.

>> >Why do you do this sort of thing repeatedly?
>> >
>> >-				while(isalnum(*src) || *src=='_') src++;
>> >+				while((isalnum)(*src) || *src=='_') src++;
>>
>> It's smaller to call the function in these places. It's not always
>> smaller to use the function as opposed to inlining the code via the
>> macro.
>
>If it's smaller to call the function then we should beat on the headers to 
>make the macro go away in platform.h.  That's one of the reasons for moving 
>headers into libbb.h; so we can override what they do.

I had a patch which did exactly this (see "Subject:.*ctype.*" this
month) and you loudly objected and said that you don't ... care about
it. I'm using this patch in my local tree, i fine-tuned it a bit more so
it saves even a tad more for me.

Oh, and note that i said "It's not always smaller to use the function",
so there is no catch-them all switch to tune these, at least AFAICS.

[snip]
>> >make bloatcheck
>> >function                                             old     new   delta
>> >run_command                                          271     983    +712
>> >builtin_export                                       373     366      -7
>> >builtin_read                                         382     366     -16
>> >builtin_source                                       229     204     -25
>> >.rodata                                           186778  186746     -32
>> >busy_loop                                           3857    3286    -571
>> >--------------------------------------------------------------------------
>> >---- (add/remove: 0/0 grow/shrink: 1/5 up/down: 712/-651)           Total:
>> > 61 bytes
>> >
>> >I have no idea why that is.  Attached is how far I got.  gcc 4.03 seems to
>>
>> You forgot the attachment..
>
>Darn it.  And I deleted it after sending.
>
>I hit some funky corner case with inlining.  I can try again from the top, but 
>lemme get a few other pending patches in first.

Yes, let's leave that for the 1.3 series. Thanks anyway that you had a
look.

cheers,



More information about the busybox mailing list