projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Speed-up lookup.
[apps/pfixtools.git]
/
common
/
tst-trie.c
diff --git
a/common/tst-trie.c
b/common/tst-trie.c
index
9f69b1e
..
739bd41
100644
(file)
--- a/
common/tst-trie.c
+++ b/
common/tst-trie.c
@@
-129,6
+129,13
@@
int main(int argc, char *argv[])
if (argc > 1) {
trie = create_trie_from_file(argv[1]);
trie_inspect(trie, false);
if (argc > 1) {
trie = create_trie_from_file(argv[1]);
trie_inspect(trie, false);
+ if (argc > 2) {
+ time_t now = time(NULL);
+ for (uint32_t i = 0 ; i < 1000000000 ; ++i) {
+ trie_lookup(trie, argv[2]);
+ }
+ printf("%lu lookups per second\n", 1000000000 / (time(NULL) - now));
+ }
trie_delete(&trie);
}
return 0;
trie_delete(&trie);
}
return 0;