From 79a34e5d5a9a93d9232efd595291bc5ebea2f2c5 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 30 Nov 2008 16:43:37 +0000 Subject: Use parserutils_hash instead of parserutils_dict. This approximately halves the size of the interned string table. We now have the following for allzengarden.css: 5507 slots used (of 8192 => 67.224121%) Data: 3 full blocks: 12288 bytes 10 partial blocks: 38946 bytes (of 40960 => 95.083008%) Total: 53488 (4112) (32) Entries: 21 full blocks: 86016 bytes 1 partial blocks: 2096 bytes (of 4096 => 51.171875%) Total: 90496 (4112) (32) Hash structures: 65592 Which gives a total dictionary size of 209,576 bytes. Note that 43% of this is parserutils_hash_entry structures (length-pointer pairs). It would be good, therefore, to be able to purge these. svn path=/trunk/libcss/; revision=5852 --- test/parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/parse.c') diff --git a/test/parse.c b/test/parse.c index 33dfe5f..fa0dae7 100644 --- a/test/parse.c +++ b/test/parse.c @@ -71,7 +71,7 @@ static css_error event_handler(css_parser_event type, int main(int argc, char **argv) { css_parser_optparams params; - parserutils_dict *dict; + parserutils_hash *dict; css_parser *parser; FILE *fp; size_t len, origlen; @@ -87,7 +87,7 @@ int main(int argc, char **argv) /* Initialise library */ assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); - assert(parserutils_dict_create(myrealloc, NULL, &dict) == + assert(parserutils_hash_create(myrealloc, NULL, &dict) == PARSERUTILS_OK); assert(css_parser_create("UTF-8", CSS_CHARSET_DICTATED, dict, @@ -132,7 +132,7 @@ int main(int argc, char **argv) css_parser_destroy(parser); - parserutils_dict_destroy(dict); + parserutils_hash_destroy(dict); assert(css_finalise(myrealloc, NULL) == CSS_OK); -- cgit v1.2.3