Source code file content

Revision: 2

import
» Project Revision History

» Checkout URL

web-content / trunk / docs / multi-thread-parsing / MultiThreadParsing.html

Size: 4500 bytes, 1 line
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
	<TITLE>C/C++ language model API tutorial. Create C/C++ Navigator.</TITLE>
	<META NAME="GENERATOR" CONTENT="StarOffice 7  (Solaris x86)">
	<META NAME="AUTHOR" CONTENT="Alexander Simon">
</HEAD>
<link rel="stylesheet" type="text/css" href="http://www.netbeans.org/netbeans.css">
<BODY LANG="en-US" DIR="LTR">
<h1>Using full power of your system to speed up the IDE</h1>
<p>Modern computers can have two or more processors. Modern processors can
have two or more cores.
How can user use computing power in parsing huge projects?
<p>The NetBeans C/C++ Development Pack can be tuned to use more then one
parsing threads.
By default single parsing thread is used at parsing.
To setup number of parsing threads you should specify Java parameter:
<pre class="examplecode">
    -J-Dcnd.modelimpl.parser.threads=&lt;number of parsing threads&gt;
</PRE>
<p>
Let's investigate influence of number of parsing threads on overall performance.
For test project was taken open source mySQL project. All sources are on network. Operating system is Solaris 10.
Computer with 2 processors. Result is:
<table border="1" cellpadding="2" cellspacing="2">
  <tbody valign="middle" align="middle">
    <tr>
      <td>Number of parser threads</td>
      <td>Time from start IDE</td>
      <td>Time after UI start</td>
    </tr>
    <tr>
      <td>1</td>
      <td>159</td>
      <td>137</td>
    </tr>
    <tr>
      <td>2</td>
      <td>115</td>
      <td>93</td>
    </tr>
    <tr>
      <td>3</td>
      <td>104</td>
      <td>82</td>
    </tr>
    <tr>
      <td>4</td>
      <td>97</td>
      <td>75</td>
    </tr>
  </tbody>
</table>
<p>Reserve one processor. All threads are running on the same processor.
It's surprise that performance increased in this case too:
<table border="1" cellpadding="2" cellspacing="2">
  <tbody valign="middle" align="middle">
    <tr>
      <td>Number of parser threads</td>
      <td>Time from start IDE</td>
      <td>Time after UI start</td>
    </tr>
    <tr>
      <td>1</td>
      <td>220</td>
      <td>174</td>
    </tr>
    <tr>
      <td>2</td>
      <td>188</td>
      <td>143</td>
    </tr>
    <tr>
      <td>3</td>
      <td>180</td>
      <td>137</td>
    </tr>
    <tr>
      <td>4</td>
      <td>174</td>
      <td>128</td>
    </tr>
  </tbody>
</table>
<p>What is about UI at parsing time?
UI is alive on any configuration. Was checked editor navigation in c++ file and hyper link navigation in the file.
<p>Let's remove network influnce on testing results. Now sources are in the hard disk.
When we analyzes results we can suppose that increasing number of threads always increases  performance.
Check suggestion on two processors computer:
<table border="1" cellpadding="2" cellspacing="2">
  <tbody valign="middle" align="middle">
    <tr>
      <td>Number of parser threads</td>
      <td>Time from start IDE</td>
      <td>Time after UI start</td>
    </tr>
    <tr>
      <td>1</td>
      <td>105</td>
      <td>86</td>
    </tr>
    <tr>
      <td>2</td>
      <td>84</td>
      <td>63</td>
    </tr>
    <tr>
      <td>3</td>
      <td>80</td>
      <td>61</td>
    </tr>
    <tr>
      <td>4</td>
      <td>76</td>
      <td>58</td>
    </tr>
    <tr>
      <td>5</td>
      <td>80</td>
      <td>59</td>
    </tr>
    <tr>
      <td>6</td>
      <td>79</td>
      <td>59</td>
    </tr>
    <tr>
      <td>8</td>
      <td>82</td>
      <td>63</td>
    </tr>
    <tr>
      <td>10</td>
      <td>83</td>
      <td>64</td>
    </tr>
  </tbody>
</table>
<p>Look at chart:
<br>
<IMG SRC="trend.png" NAME="Perfomance" ALIGN=BOTTOM BORDER=0>
<p>You can see that performance increased while number of parser threads less then 4. beginning with 5 threads performance is slightly decreased.
<p>Hence on two processor computer you can increase parsing performance if number of parsing threads will be 4.
<p>Main investigation idea is: How does number of threads increase overall performance? Does it have influence on UI?
Answer is: Using multi-thread parsing increases overall parsing performance. On computer with two processor gain is about 32%.
<p>Note. Unfortunately CND 5.5 release has concurrent modification exception (if you uses multi-thread parsing).
Hence we cannot recommend users to increase number of parsing threads in CND 5.5.
I done investigation on CND with locally fixed exception.
</body>
</html>

Project Features

About this Project

CND was started in November 2009, is owned by DimaZh, and has 198 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close