diff options
author | Timo Teras <timo.teras@iki.fi> | 2011-06-20 09:49:56 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-06-20 09:49:56 +0200 |
commit | adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3 (patch) | |
tree | 5bb62bad050d86c1b711a19a1ea9e7ae525b9311 /include | |
parent | e12e0acb92329f95a77121f489b491d84b6a2c33 (diff) | |
download | busybox-w32-adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3.tar.gz busybox-w32-adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3.tar.bz2 busybox-w32-adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3.zip |
parse_config: use getline. BIG speedup with glibc (~40%).
function old new delta
config_read 559 604 +45
getline - 23 +23
config_close 29 49 +20
find_pair 169 187 +18
showmode 330 338 +8
hash_find 233 234 +1
builtin_umask 133 132 -1
lzo1x_optimize 1434 1429 -5
test_main 253 247 -6
buffer_fill_and_print 196 179 -17
create_J 1849 1826 -23
config_free_data 37 - -37
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 5/5 up/down: 138/-89) Total: 26 bytes
Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 2cac7e60c..953bec334 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1184,8 +1184,9 @@ enum { | |||
1184 | }; | 1184 | }; |
1185 | typedef struct parser_t { | 1185 | typedef struct parser_t { |
1186 | FILE *fp; | 1186 | FILE *fp; |
1187 | char *line; | ||
1188 | char *data; | 1187 | char *data; |
1188 | char *line, *nline; | ||
1189 | size_t line_alloc, nline_alloc; | ||
1189 | int lineno; | 1190 | int lineno; |
1190 | } parser_t; | 1191 | } parser_t; |
1191 | parser_t* config_open(const char *filename) FAST_FUNC; | 1192 | parser_t* config_open(const char *filename) FAST_FUNC; |