summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50d1b34)
raw | patch | inline | side by side (parent: 50d1b34)
author | Florian Forster <octo@collectd.org> | |
Tue, 14 Jan 2014 06:24:40 +0000 (07:24 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 14 Jan 2014 06:41:34 +0000 (07:41 +0100) |
cache_compare() is one of the hottest functions in collectd. Depending how many
metrics collectd handles (how deep the tree is) it gets called an order of
magnitude or two more often than the number of metrics handled. With 100k
metrics, about 6.6% of the CPU time were spent within cache_compare(), with
this commit this reduces to 6.3% (that's, uhm, 4.7% faster?).
metrics collectd handles (how deep the tree is) it gets called an order of
magnitude or two more often than the number of metrics handled. With 100k
metrics, about 6.6% of the CPU time were spent within cache_compare(), with
this commit this reduces to 6.3% (that's, uhm, 4.7% faster?).
src/utils_cache.c | patch | blob | history |
diff --git a/src/utils_cache.c b/src/utils_cache.c
index fa6e6603ec3e10eedcdc6ea7d56ab64a0b04db6e..05386db9d33e9f12fa486ec90cf5cbf67868c23d 100644 (file)
--- a/src/utils_cache.c
+++ b/src/utils_cache.c
static int cache_compare (const cache_entry_t *a, const cache_entry_t *b)
{
+#if COLLECT_DEBUG
assert ((a != NULL) && (b != NULL));
+#endif
return (strcmp (a->name, b->name));
} /* int cache_compare */