diff options
author | Timo Teras | 2011-06-20 09:49:56 +0200 |
---|---|---|
committer | Denys Vlasenko | 2011-06-20 09:49:56 +0200 |
commit | adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3 (patch) | |
tree | 5bb62bad050d86c1b711a19a1ea9e7ae525b9311 /include/libbb.h | |
parent | e12e0acb92329f95a77121f489b491d84b6a2c33 (diff) | |
download | busybox-adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3.zip busybox-adcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3.tar.gz |
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/libbb.h')
-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 2cac7e6..953bec3 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1184,8 +1184,9 @@ enum { }; typedef struct parser_t { FILE *fp; - char *line; char *data; + char *line, *nline; + size_t line_alloc, nline_alloc; int lineno; } parser_t; parser_t* config_open(const char *filename) FAST_FUNC; |