Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 2e9c43658e374d290a2de15d25134ac8 > files > 873

db4o-doc-8.0-1.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="2" MadCap:lastHeight="120" MadCap:lastWidth="624" MadCap:disableMasterStylesheet="true" MadCap:tocPath="" MadCap:InPreviewMode="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" MadCap:PathToHelpSystem="../../../" MadCap:HelpSystemFileName="index.xml" MadCap:SearchType="Stem">
    <head><title>First Steps	</title>
        <script type="text/javascript">/* <![CDATA[ */
window.onload = function(){
	var pathToFlash = $('html').attr('MadCap:PathToHelpSystem') + 'Content/Resources/Code/ZeroClipboard.swf';
	ZeroClipboard.setMoviePath(pathToFlash);
			
	function bindToClipBord(element,content){
		var clip = new ZeroClipboard.Client();
		clip.setText(content);
		clip.glue(element);
	};
		
	if(location.protocol==='file:'){
		$('.copylink-marker').remove();
	} else{
			$('.copylink-marker').each(function(){
				var text = $(this).parent().parent().children('.prettyprint').html();
				$(this).hover(function(){
					bindToClipBord(this,text);
				},
				function(){});
			});	
	}		
	prettyPrint();	
};
                /* ]]> */</script>
        <link href="../../Resources/Stylesheets/OnlineStyle.css" rel="stylesheet" />
        <script src="../../Resources/Code/prettify.js">
        </script>
        <script src="../../Resources/Code/lang-vb.js">
        </script>
        <script src="../../Resources/Code/jquery.min.js">
        </script>
        <script src="../../Resources/Code/ZeroClipboard.js">
        </script>
        <script src="../../SkinSupport/MadCapAll.js" type="text/javascript">
        </script>
    </head>
    <body>
        <p class="MCWebHelpFramesetLink" style="display: none;"><a href="../../../index_CSH.html#tuning/io_benchmark_tools/first_steps.htm" style="">Open topic with navigation</a>
        </p>
        <p>
            <script type="text/javascript">/*<![CDATA[*/document.write('<a href="' + location.href +'">');
				document.write("Direct Link");
			document.write('</a>');/*]]>*/</script>
        </p>
        <p>
        </p>
        <h1>First Steps</h1>
        <p>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.
			
		<pre class="prettyprint" xml:space="preserve">
private void run(IoBenchmarkArgumentParser argumentParser) throws IOException {             
	runTargetApplication(argumentParser.objectCount()); 
	prepareDbFile(argumentParser.objectCount());     
	runBenchmark(argumentParser.objectCount());     
}  		
		</pre> <![CDATA[ ]]><br /> As you can see from this code, the benchmark consists of 3 stages: </p>
        <ol>
            <li value="1">Run a target application and log its I/O access pattern</li>
            <li value="2">Replay the recorded I/O operations once to prepare a database file.  This
step is necessary to ensure that during the grouped replay in the next
step, none of the accesses will go beyond the currently existing file.</li>
            <li value="3">Replay
the recorded I/O operations a second time. Operations are grouped by
command type (read, write, seek, sync), and the total time executing
all operations of a specific command type is measured. Grouping is
necessary to avoid micro-benchmarking effects and to get time values
above timer resolution. </li>
        </ol>We divide the numbers collected in
stage 3 by the respective number of operations and we calculate the 
average time a particular command takes on the given system.  But enough of the theory for the moment, let's see how you can run the benchmark. For this purpose there is the pair of an Ant script and a properties file: <ul><li value="1">IoBenchmark.xml: The Ant script</li><li value="2">IoBenchmark.properties: Holding configurations for the Ant script </li></ul>Both files are located in the root of db4otools.  To
be able to run the benchmark from the Ant script, you have to put a
db4o JAR file in the lib folder of the db4otools project. Insert the
name of the JAR in the db4o.jar property in the property file, e.g.  <pre>    db4o.jar=db4o-7.1.27.9109-java5.jar</pre>and 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:

<pre xml:space="preserve">=================     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      &gt; operations executed: 14331     &gt; time elapsed: 16 ms     &gt; operations per millisecond: 895.6875     &gt; average duration per operation: 0.001116460819203126 ms     READ 1116 ns           Results for WRITE      &gt; operations executed: 9508     &gt; time elapsed: 16 ms     &gt; operations per millisecond: 594.25     &gt; average duration per operation: 0.0016827934371055953 ms     WRITE 1682 ns           Results for SYNC      &gt; operations executed: 7821     &gt; time elapsed: 921 ms     &gt; operations per millisecond: 8.49185667752443     &gt; average duration per operation: 0.11775987725354814 ms     SYNC 117759 ns           Results for SEEK      &gt; operations executed: 23839     &gt; time elapsed: 16 ms     &gt; operations per millisecond: 1489.9375     &gt; average duration per operation: 6.711690926632829E-4 ms     SEEK 671 ns </pre>As 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.
  
         
    <script type="text/javascript" src="../../SkinSupport/MadCapBodyEnd.js"></script></body>
</html>