The main class of the benchmark is com.db4o.bench.IoBenchmark. Let's have a look at its run method to see what it does.
private void run(IoBenchmarkArgumentParser argumentParser) throws IOException { runTargetApplication(argumentParser.objectCount()); prepareDbFile(argumentParser.objectCount()); runBenchmark(argumentParser.objectCount()); }
db4o.jar=db4o-7.1.27.9109-java5.jarand you are ready to go! To give it a first try, you can run the run.benchmark.small target of the Ant script, which is also the default target. You should get output similar to this:
================= Running db4o IoBenchmark ========= Running target application ... Preparing DB file ... Running benchmark ... --------------------------------- db4o IoBenchmark results with 1000 items Statistics written to db4o-IoBenchmark-results-1000.log ------------------------------------------------------------- Results for READ > operations executed: 14331 > time elapsed: 16 ms > operations per millisecond: 895.6875 > average duration per operation: 0.001116460819203126 ms READ 1116 ns Results for WRITE > operations executed: 9508 > time elapsed: 16 ms > operations per millisecond: 594.25 > average duration per operation: 0.0016827934371055953 ms WRITE 1682 ns Results for SYNC > operations executed: 7821 > time elapsed: 921 ms > operations per millisecond: 8.49185667752443 > average duration per operation: 0.11775987725354814 ms SYNC 117759 ns Results for SEEK > operations executed: 23839 > time elapsed: 16 ms > operations per millisecond: 1489.9375 > average duration per operation: 6.711690926632829E-4 ms SEEK 671 nsAs the output indicates, the results of this benchmark run will also be written to a file called db4o-IoBenchmark-results-1000.log. You can find this file in the db4otools directory. The ns (nanosecond) values are our benchmark standard for the respective operation. Smaller numbers are better. Note: It may be possible, that you get some zero values for time elapsed, and therefore infinity for operations per ms. This can occur if your machine is fast enough to execute all operations under 1ms. To overcome this you can run the run.benchmark.medium target which operates with more objects and takes longer to complete.