Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 1a14ff5

Browse files
author
Josh MacDonald
committed
Initial checkin of C++ btree code, has some useless google3-specific
bits to be removed and needs a Makefile.
0 parents  commit 1a14ff5

19 files changed

+5669
-0
lines changed

Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# -*- mode: python; -*-
2+
3+
# This should be a Makefile, but it's not.
4+
5+
# cc_library(name = "btree",
6+
# srcs = [ "btree.h",
7+
# "btree_container.h",
8+
# "btree_map.h",
9+
# "btree_set.h",
10+
# "safe_btree.h",
11+
# "safe_btree_map.h",
12+
# "safe_btree_set.h" ],
13+
# deps = [ "//strings",
14+
# "//strings:cord" ])
15+
16+
# cc_library(name = "btree_test_flags",
17+
# srcs = [ "btree_test_flags.cc" ],
18+
# deps = [ "//base" ])
19+
20+
# cc_binary(name = "btree_bench",
21+
# srcs = [ "btree_bench.cc" ],
22+
# deps = [ ":btree",
23+
# ":btree_test_flags",
24+
# "//testing/base",
25+
# "//util/random" ])
26+
27+
# cc_test(name = "btree_test",
28+
# srcs = [ "btree_test.cc", ],
29+
# deps = [ ":btree",
30+
# ":btree_test_flags",
31+
# "//base:heapcheck",
32+
# "//testing/base",
33+
# "//util/random",
34+
# ],
35+
# size = "large")
36+
37+
# cc_test(name = "safe_btree_test",
38+
# srcs = [ "safe_btree_test.cc", ],
39+
# deps = [ ":btree",
40+
# ":btree_test_flags",
41+
# "//base:heapcheck",
42+
# "//testing/base",
43+
# "//util/random",
44+
# ],
45+
# size = "large")
46+
47+
# cc_fake_binary(name = "btree_nc",
48+
# srcs = [ "btree_nc.cc" ],
49+
# deps = [ ":btree" ],
50+
# legacy = 0)
51+
52+
# py_test(name = "btree_nc_test",
53+
# srcs = [ "btree_nc_test.py" ],
54+
# deps = [ "//pyglib",
55+
# "//testing/pybase" ],
56+
# data = [ "btree_nc" ],
57+
# size = "large")
58+
59+
# cc_binary(name = "btree_test_program",
60+
# srcs = [ "btree_test_program.cc" ],
61+
# deps = [ ":btree",
62+
# "//devtools/gdb/component:gdb_test_utils" ],
63+
# testonly = 1)
64+
65+
# # This test will only actually test the pretty-printing code if it's
66+
# # compiled with debug information (blaze build -c dbg). The default
67+
# # mode, fastbuild, will pass but will not catch any regressions!
68+
# py_test(name = "btree_printer_test",
69+
# size = "large",
70+
# srcs = [ "btree_printer_test.py",
71+
# "btree_printer.py" ],
72+
# deps = [ "//devtools/gdb/component:gdbpy",
73+
# "//testing/pybase",
74+
# "//testing/gdb:gdb_script_test_util",
75+
# ":btree_test_program" ])

benchmarks.awk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/gawk -f
2+
3+
/^Run on/ {
4+
print $0;
5+
printf "%-25s %5s %-20s\n",
6+
"Benchmark", "STL(ns)", "B-Tree(ns) @ <size>"
7+
printf "--------------------------------------------------------\n";
8+
}
9+
10+
/^BM_/ {
11+
split($1, name, "_");
12+
if (name[2] == "stl") {
13+
stl = $3;
14+
stl_bytes = $5
15+
printf "%-25s %5d ", name[1] "_" name[3] "_" name[4] "_" name[5], stl;
16+
fflush();
17+
} else if (name[2] == "btree") {
18+
btree = $3
19+
btree_size = name[3]
20+
btree_bytes = $5
21+
printf "%5d %+7.2f%% <%3d>", btree, 100.0 * (stl - btree) / stl, btree_size;
22+
printf " [%4.1f, %4.1f]\n", stl_bytes, btree_bytes;
23+
fflush();
24+
} else {
25+
printf "ERROR: %s unrecognized\n", $1
26+
}
27+
}

0 commit comments

Comments
 (0)