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 143956 - low performance of error and semantic highlighting
Summary: low performance of error and semantic highlighting
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 140850
  Show dependency tree
 
Reported: 2008-08-14 17:23 UTC by Alexander Simon
Modified: 2008-09-12 17:31 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
status prosessing log (1.63 KB, text/plain)
2008-08-14 17:27 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2008-08-14 17:23:55 UTC
Low performance of error highlighting for large sources.
For example take uts project from OpenSolaris, open project, wait parsing and open file:
usr/src/uts/common/dtrace/dtrace.c
Waiting about 130 seconds
Semantic highlighting is appeared.
Waiting about 130 seconds
File status is changed to processing.
Waiting about 110 seconds
File status is changed to error and error highlighting is appeared.
So all process consumes 370 seconds.
By the way, parsing time is less then 400 seconds.
Comment 1 Alexander Simon 2008-08-14 17:27:04 UTC
Created attachment 67445 [details]
status prosessing log
Comment 2 Alexander Simon 2008-08-15 07:05:09 UTC
I would like to suggest a speed target:
The highlighting should process 1000 lines of code in 1 second.
If feature cannot achieve such speed we should provide another solution for the highlighting.
For example:
- split the highlighting process on small part.
- highlight visible objects at first.
- cancel the highlighting process if user change file.
- do not show more then 100 errors in the file
Comment 3 Alexander Simon 2008-08-25 13:54:02 UTC
fixing, change set:
http://hg.netbeans.org/main/rev/e6c9eeca4306
- run mark occurrences in separate thread (hence mark occurrences does not wait error and semantic highlighting)
Comment 4 Alexander Simon 2008-08-25 16:00:55 UTC
fixing:
http://hg.netbeans.org/main/rev/87f3a5ae750d
- make occurrences task cancellable
http://hg.netbeans.org/main/rev/c53f19549c3b
- do not process one file twice (if project contains links, for example MySQL, file mysql-5.0.18/client/client_priv.h)
Comment 5 Quality Engineering 2008-08-26 05:59:47 UTC
Integrated into 'main-golden', available in build *200808260201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/e6c9eeca4306
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing: IZ#143956:low performance of error and semantic highlighting
- run mark occurrences in separate thread
Comment 6 Vladimir Voskresensky 2008-09-04 14:09:06 UTC
I turned OFF expensive (from performance point of view) features for files > 4000 lines.

This can be changed by setting flag "cnd.semantic.max.line" 
values <0 turn OFF limitation, 
positive values change default 4000 lines limit to new one

http://hg.netbeans.org/main?cmd=changeset;node=a5cbcb0669f3
Comment 7 Alexander Simon 2008-09-05 14:53:15 UTC
improve performance:
- get unit by unitID
- MemoryCache (remove unnecessary statement on critical method)
- CharSequenceKey (create special byte compare)
- RepositoryUtils (remove unnecessary statements in critical methods)
- CsmContext iteraror
- CsmProject.findFile()
in change sets:
http://hg.netbeans.org/main?cmd=changeset;node=6fe91d5e38ed
http://hg.netbeans.org/main?cmd=changeset;node=05c7665a5fb2
http://hg.netbeans.org/main?cmd=changeset;node=8f9f3e200169
http://hg.netbeans.org/main?cmd=changeset;node=e634d76db878
http://hg.netbeans.org/main?cmd=changeset;node=fb6e2316cb7e
http://hg.netbeans.org/main?cmd=changeset;node=9e7aa3212831
Comment 8 Quality Engineering 2008-09-06 05:24:39 UTC
Integrated into 'main-golden', will be available in build *200809060201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6fe91d5e38ed
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting (get unit by unitID)
Comment 9 Quality Engineering 2008-09-09 17:32:18 UTC
Integrated into 'main-golden', will be available in build *200809091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b5b4a57a5af4
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- cache namespace hash code
- improve iteraror in a find declaration by offset
Comment 10 Quality Engineering 2008-09-10 06:07:14 UTC
Integrated into 'main-golden', will be available in build *200809100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/459d57a44889
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- static variables and declarations are cached  in resolved file context
Comment 11 Alexander Simon 2008-09-10 08:58:49 UTC
improve performance:
- use right case sensitive flag in finders
in change set:
http://hg.netbeans.org/main/rev/25faddecad65
Comment 12 Quality Engineering 2008-09-10 17:13:04 UTC
Integrated into 'main-golden', will be available in build *200809101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/25faddecad65
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- use right case sensitive flag in finders
Comment 13 Alexander Simon 2008-09-11 16:52:59 UTC
improve performance:
-cache file macros
-improve extract namespaces from using directives
-improve extract namespaces from using directives
-remove blinking of semantic highlighting
-store project in weak reference in file and name space
-make repository classes final
-fix slice hash in memory cache
in change sets:
http://hg.netbeans.org/main?cmd=changeset;node=903af397a1b0
http://hg.netbeans.org/main?cmd=changeset;node=f23e92462889
http://hg.netbeans.org/main?cmd=changeset;node=ffe1a0471f6f
http://hg.netbeans.org/main?cmd=changeset;node=e25960dae3a6
http://hg.netbeans.org/main?cmd=changeset;node=04d64ff7ec63
http://hg.netbeans.org/main?cmd=changeset;node=ca315a4731bd
Comment 14 Alexander Simon 2008-09-11 17:28:49 UTC
Problem was fixed:
Highlighting of source 4000-lines file consumes about 10 seconds.
Field/method semantic and error highlighting for huge files (bigger then 4000 lines) is switched off.
Comment 15 Quality Engineering 2008-09-11 17:41:36 UTC
Integrated into 'main-golden', will be available in build *200809111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/903af397a1b0
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- cache file macros
Comment 16 Quality Engineering 2008-09-12 06:01:50 UTC
Integrated into 'main-golden', will be available in build *200809120201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/04d64ff7ec63
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- store project in weak reference in file and name space
- make repository classes final
Comment 17 Quality Engineering 2008-09-12 17:31:18 UTC
Integrated into 'main-golden', will be available in build *200809121401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/91bf32cd1181
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#143956:low performance of error and semantic highlighting
- remove running init task from constructor of highlighter because it will be invoked later in other thread