awk: experimentally modify "global" trick to make code smaller
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 7 Jun 2007 13:14:53 +0000 (13:14 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 7 Jun 2007 13:14:53 +0000 (13:14 -0000)
commite16e6e79e456ee29646d0008437145ed282e8a6b
tree9d4f2e8a27ce8f733add033b802c7b2d1473b35c
parent4b495128819221a669a59b533ca510da341dcd06
awk: experimentally modify "global" trick to make code smaller
by minimizing data offsets

function                                             old     new   delta
parse_expr                                           752     782     +30
syntax_error                                          23      26      +3
nvfree                                               151     154      +3
nvalloc                                              172     175      +3
fsrealloc                                            111     114      +3
chain_node                                            99     102      +3
chain_loop                                           121     124      +3
chain_group                                          628     631      +3
awk_main                                            1002    1005      +3
awk_exit                                              99     102      +3
parse_program                                        308     310      +2
split_f0                                             172     170      -2
awk_split                                            510     507      -3
getvar_s                                             108     102      -6
awk_sub                                              643     637      -6
awk_getline                                          706     700      -6
next_token                                           943     927     -16
handle_special                                       470     446     -24
next_input_file                                      252     213     -39
evaluate                                            6703    6633     -70
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/9 up/down: 59/-172)         Total: -113 bytes

# size */*/awk.o
   text    data     bss     dec     hex filename
  18247       0       0   18247    4747 busybox.t0/editors/awk.o
  18134       0       0   18134    46d6 busybox.t1/editors/awk.o
editors/awk.c