MCPcopy Create free account
hub / github.com/e2wugui/zeze / main1

Method main1

ZezeJava/ZezeJavaTest/src/Benchmark/BenchRocksDb.java:18–36  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

16
17public class BenchRocksDb {
18 public static void main1(String[] args) throws Exception {
19 System.out.println("begin");
20 var dbHome = "~$BenchRocksDb";
21 Application.renameAndDeleteDirectory(new File(dbHome));
22
23 long t = System.nanoTime();
24 try (var rocksDb = new RocksDatabase(dbHome)) {
25 System.out.println("open: " + (System.nanoTime() - t) / 1_000_000 + " ms");
26 for (var table : rocksDb.getTableMap().values()) {
27 System.out.println("table: " + table.getName() + " => " + table.getCfHandle().getID() + ':'
28 + new String(table.getCfHandle().getName(), StandardCharsets.UTF_8));
29 }
30
31 t = System.nanoTime();
32 for (int i = 100; i < 200; i++)
33 rocksDb.getOrAddTable("table" + i);
34 System.out.println("newC: " + (System.nanoTime() - t) / 1_000_000 + " ms");
35 }
36 }
37
38 public static void main2(String[] args) throws Exception {
39 System.out.println("begin");

Callers

nothing calls this directly

Calls 6

getTableMapMethod · 0.80
getCfHandleMethod · 0.80
valuesMethod · 0.65
getNameMethod · 0.65
getOrAddTableMethod · 0.45

Tested by

no test coverage detected