remove unneeded data items from hashtable code

These items were used for statistics tracking, but no code at all
exists to consume them. By removing them we save

a) space
   because they counters required space, and did so in each and every
   json object

b) performance
   because calloc() needs to write less data and the counters are
   no longer maintained; cache performance can be better, load
   on OS main memory is lighter

We could conditionally enable/disable these counters, but I have not
done this they were really nowhere used and it looked more like a
left-over from the import of hashtable code.
This commit is contained in:
Rainer Gerhards
2015-09-23 12:40:57 +02:00
parent 8f8d03df46
commit 1ae4b50bde
3 changed files with 11 additions and 47 deletions

View File

@@ -69,7 +69,7 @@ static struct lh_table *json_object_table;
static void json_object_init(void) __attribute__ ((constructor));
static void json_object_init(void) {
MC_DEBUG("json_object_init: creating object table\n");
json_object_table = lh_kptr_table_new(128, "json_object_table", NULL);
json_object_table = lh_kptr_table_new(128, NULL);
}
static void json_object_fini(void) __attribute__ ((destructor));
@@ -374,7 +374,7 @@ struct json_object* json_object_new_object(void)
jso->_delete = &json_object_object_delete;
jso->_to_json_string = &json_object_object_to_json_string;
jso->o.c_object = lh_kchar_table_new(JSON_OBJECT_DEF_HASH_ENTRIES,
NULL, &json_object_lh_entry_free);
&json_object_lh_entry_free);
if (!jso->o.c_object)
{
json_object_generic_delete(jso);