Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1219

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Hardware Resources</title>
    <link rel="stylesheet" type="text/css" href="../../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Hardware Resources</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script><p><br></p><p>Initial object storing requires little calculation, but can
be resource consuming on disk access. Therefore the main hardware resource that
will affect db4o insert performance is the hard drive. The faster is the hard
drive the better performance you will get. </p>

<p>An alternative to a hard drive database storage can be a
database file stored in RAM. This can be done by placing the database file in a
designated RAM-drive or by using db4o memory io-adapter:</p>



<span name="cs_wiki_filter" csw_filters="net"><p>.NET:&nbsp;</p>

<p>configuration.Io(new MemoryIoAdapter());</p>

</span>



<p>The following test can be performed to compare performance
of a hard drive and a RAM drive:</p>



<span name="cs_wiki_filter" csw_filters="net">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InsertPerformanceBenchmark.cs: <span class="fscMemberName">RunRamDiskTest</span></span></div><div class="fscCode"><pre ID="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RunRamDiskTest()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Open_Text').style.display='inline';"/>        </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_RunRamDiskTest_787_79_38_546_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ConfigureRamDrive();
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            InitForHardDriveTest();
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Clean();
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Storing </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> _count </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> objects of depth </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> _depth </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> on a hard drive:</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Open();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Store();
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Close();
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            InitForRamDriveTest();
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Clean();
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Storing </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> _count </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> objects of depth </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> _depth </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> on a RAM disk:</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Open();
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Store();
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Close();
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InsertPerformanceBenchmark.cs: <span class="fscMemberName">ConfigureRamDrive</span></span></div><div class="fscCode"><pre ID="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> ConfigureRamDrive()
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Open_Text').style.display='inline';"/>        </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_ConfigureRamDrive_870_82_41_242_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IConfiguration config </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.Configure();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            config.LockDatabaseFile(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            config.WeakReferences(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            config.FlushFileBuffers(</span><span style="color: #0000FF;">true</span><span style="color: #000000;">);
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InsertPerformanceBenchmark.cs: <span class="fscMemberName">InitForHardDriveTest</span></span></div><div class="fscCode"><pre ID="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> InitForHardDriveTest()
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Open_Text').style.display='inline';"/>        </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForHardDriveTest_956_85_44_189_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _count </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">100000</span><span style="color: #000000;">;
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _depth </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">3</span><span style="color: #000000;">;
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _filePath </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">performance.db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _isClientServer </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InsertPerformanceBenchmark.cs: <span class="fscMemberName">InitForRamDriveTest</span></span></div><div class="fscCode"><pre ID="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> InitForRamDriveTest()
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Open_Text').style.display='inline';"/>        </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_InitForRamDriveTest_1045_84_43_192_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _count </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">100000</span><span style="color: #000000;">;
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _depth </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">3</span><span style="color: #000000;">;
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _filePath </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">r:\\performance.db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            _isClientServer </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InsertPerformanceBenchmark.cs: <span class="fscMemberName">Store</span></span></div><div class="fscCode"><pre ID="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Store()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Open_Text').style.display='inline';"/>        </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_29_471_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            StartTimer();
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">; i </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> _count; i</span><span style="color: #000000;">++</span><span style="color: #000000;">)
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Open_Text').style.display='inline';"/>            </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_114_360_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                Item item </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Item(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">load</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> j </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">; j </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> _depth; j</span><span style="color: #000000;">++</span><span style="color: #000000;">)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Open_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Closed_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Closed_Text').style.display='inline';"/><img id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Closed_Text').style.display='none'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Open_Image').style.display='inline'; document.getElementById('..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Open_Text').style.display='inline';"/>                </span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..PerformanceCS.ZipsInsertPerformanceBenchmark.Cs_InsertPerformanceBenchmark.Cs_Store_1133_70_233_303_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    item </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Item(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">load</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, item);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>                }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                objectContainer.Set(item);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>            }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            objectContainer.Commit();
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            StopTimer(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Store </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> TotalObjects() </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> objects</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>



<p>The RAM driver was downloaded <a href="http://www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/">here</a>
and installed on R:\ drive.</p>

<p>The following results were achieved for the
<a href="../insert_performance.html" class="wikiLink">testing configuration</a>:</p>



<span name="cs_wiki_filter" csw_filters="net"><p>.NET:&nbsp;</p>

<p>Storing 100000 objects of depth 3 on a hard drive:</p>

<p>Store 300000 objects: 18629ms</p>

<p>Storing 100000 objects of depth 3 on a RAM disk:</p>

<p>Store 300000 objects: 17752ms</p>

</span></div>
    </div>
    <div id="footer">
					This revision (3) was last Modified 2007-12-30T14:31:07 by Tetyana.
				</div>
  </body>
</html>