diff options
author | Emilio G. Cota <cota@braap.org> | 2016-06-08 14:55:26 -0400 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2016-06-11 23:10:19 +0000 |
commit | bf3afd5f419a2054bf03d963bdd223fbb27b72d2 (patch) | |
tree | d59bfaeb23c75fbf3528a01a07b51649c12d7541 /util/Makefile.objs | |
parent | 42bd32287f3a18d823f2258b813824a39ed7c6d9 (diff) |
qdist: add module to represent frequency distributions of data
Sometimes it is useful to have a quick histogram to represent a certain
distribution -- for example, when investigating a performance regression
in a hash table due to inadequate hashing.
The appended allows us to easily represent a distribution using Unicode
characters. Further, the data structure keeping track of the distribution
is so simple that obtaining its values for off-line processing is trivial.
Example, taking the last 10 commits to QEMU:
Characters in commit title Count
-----------------------------------
39 1
48 1
53 1
54 2
57 1
61 1
67 1
78 1
80 1
qdist_init(&dist);
qdist_inc(&dist, 39);
[...]
qdist_inc(&dist, 80);
char *str = qdist_pr(&dist, 9, QDIST_PR_LABELS);
// -> [39.0,43.6)▂▂ █▂ ▂ ▄[75.4,80.0]
g_free(str);
char *str = qdist_pr(&dist, 4, QDIST_PR_LABELS);
// -> [39.0,49.2)▁█▁▁[69.8,80.0]
g_free(str);
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1465412133-3029-9-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'util/Makefile.objs')
-rw-r--r-- | util/Makefile.objs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/util/Makefile.objs b/util/Makefile.objs index a8a777ec40..702435e839 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -32,3 +32,4 @@ util-obj-y += buffer.o util-obj-y += timed-average.o util-obj-y += base64.o util-obj-y += log.o +util-obj-y += qdist.o |