This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194031 - Large C++ consume too many resources.
Summary: Large C++ consume too many resources.
Status: RESOLVED INCOMPLETE
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@cnd
URL:
Keywords: PERFORMANCE, UI
Depends on:
Blocks:
 
Reported: 2011-01-04 21:43 UTC by JDKunk
Modified: 2011-01-27 13:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JDKunk 2011-01-04 21:43:32 UTC
Large C++ projects like the llvm compiler consume too many resources when the whole project is parsed by the NetBeans project debugger/database/code model. It can take upwards of 20 minutes to fully parse the project, and it consumes upwards of 600mb of memory. 

I believe the NetBeans should not try to parse the whole project at once, it should be lazy. When the user opens a file, one merely calls the parser to parse the file, then it should parse the headers recursively until everything which needs to be parsed is parsed. This will decrease the time footprint.

The memory footprint can be lowered by releasing already parsed files. So the parser calls files to be parsed, and the parser sees that they are already parsed or parses it. At this point it can place a time stamp on the file. The parser every so often iterates through the files to check the last time a file was used. If the last use of a file is above a certain threshold, the debug-info-database can release all information related with that file. 10 minutes seems like a good number to me.

Finally, the whole application stalls while it is parsing. The CPU meter goes to 100, and nothing can be accomplished. This should not be so. I cannot be certain about the internals, but something like thread priority must exist. The parser thread should be lower than the graphical user interface thread. In fact, everything should be lower than the graphical user interface thread because it's the most important part of a graphical application.

- Thanks,
Jeff Kunkel
Comment 1 soldatov 2011-01-04 22:36:58 UTC
Can you add direct link to llvm. IDE should not parse small projects like Firefox browser more than 1-2 minutes. But on llvm.org I see small (5 - 53Mb) archives only.
Comment 2 soldatov 2011-01-05 12:14:26 UTC
"LLVM source code (9M)" archive works nicely
Automatic import fails on "LLVM-GCC 4.2 Front End Source Code (53M)" archive, because this project contains non-standard configure script:

sova@sova:~/llvm-src/llvm-gcc-4.2-2.8.source$ ./configure CC=/usr/bin/gcc CXX=/usr/bin/g++ CFLAGS="-g3 -gdwarf-2" CXXFLAGS="-g3 -gdwarf-2"
configure: warning: CC=/usr/bin/gcc: invalid host type
configure: warning: CXX=/usr/bin/g++: invalid host type
configure: error: can only configure for one host and one target at a time
Comment 3 nnnnnk 2011-01-27 13:54:35 UTC
There was done a lot of performance improvements since 6.9 release.
Please, could you try current development version of NetBeans and reopen a bug if problem still will be in place.