MCPcopy Create free account
hub / github.com/acl-dev/acl / test_token_tree_cpp

Function test_token_tree_cpp

lib_acl_cpp/samples/benchmark/token_tree/main.cpp:43–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43static void test_token_tree_cpp(int max)
44{
45 acl::token_tree tree;
46
47 for (int i = 0; tokens[i] != NULL; i++) {
48 tree.insert(tokens[i]);
49 }
50
51 acl::meter_time(__FUNCTION__, __LINE__, "begin\t");
52
53 int j = 0;
54 for (int i = 0; i < max; i++) {
55 const acl::token_node* node = tree.find(tokens[j]);
56 if (node == NULL) {
57 printf("find error, key=%s\r\n", tokens[j]);
58 break;
59 }
60 if (tokens[++j] == NULL) {
61 j = 0;
62 }
63 }
64
65 acl::meter_time(__FUNCTION__, __LINE__, "end\t");
66}
67
68static void test_htable(int max)
69{

Callers 1

mainFunction · 0.85

Calls 3

meter_timeFunction · 0.85
insertMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…