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 184370 - [code model, highlighter] Highlighter is very slow opening un-cached files
Summary: [code model, highlighter] Highlighter is very slow opening un-cached files
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords: PERFORMANCE
: 108853 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-16 15:17 UTC by rmartins
Modified: 2010-04-29 13:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profile with tmp on disk (653.50 KB, text/xml)
2010-04-28 15:56 UTC, rmartins
Details
Profile with tmp on ramdisk (539.81 KB, application/zip)
2010-04-28 16:07 UTC, rmartins
Details
disk profile (78.64 KB, application/octet-stream)
2010-04-29 08:24 UTC, Vladimir Voskresensky
Details
on ram disk (133.39 KB, application/octet-stream)
2010-04-29 08:25 UTC, Vladimir Voskresensky
Details
proper on ram disk (81.55 KB, application/octet-stream)
2010-04-29 13:41 UTC, rmartins
Details
profile parsing project - ram disk (153.59 KB, application/octet-stream)
2010-04-29 13:46 UTC, rmartins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rmartins 2010-04-16 15:17:22 UTC
Hi,
when opening a file for the first time, the highlighter takes a long time to finish (until the green/yellow/red square shows up).
This could be a combination of problems, highlighter + parsing speed, or a standalone issue with the highlighter...

Thanks,
Rolando
Comment 1 Vladimir Voskresensky 2010-04-17 09:13:08 UTC
Rolando,
Do you mean the first file only?
I.e. when for the first file box is green, try to open the next file. Is green state appears faster? Or the same speed as the first file?

(There is some activity for initial building of "overriden/override" annotations which can be the reason)
Comment 2 rmartins 2010-04-18 18:15:02 UTC
Hi Vladimir,
They have the same speed as the first file.
(but if you close a file and re-open it, there is no delay)

Thanks,
Rolando
Comment 3 Vladimir Voskresensky 2010-04-27 15:25:23 UTC
Hi Rolando,

I have changed the order of highlighters and now "overriden/override" has the lowest priority => I can not reproduce the issue.
Can you tell me the name of file in ace+tao where you see slowness now and reopen the bug?

http://hg.netbeans.org/cnd-main?cmd=changeset;node=0c1abe1e8a61
Comment 4 Vladimir Voskresensky 2010-04-28 10:43:27 UTC
Hi Rolando,

I think your problem was (I have checked on cold system)
- opening ACE+TAO from repository
- open TestS.cpp file => it takes 37 sec (under profiler) to highlight fields (macros are highlighted after 7 sec)

as I see in profiler:
- for the first time we spend the most time in reading repository
- reading included files

- Macros HL itself:
org.netbeans.modules.cnd.highlight.semantic.ModelUtils.getMacroBlocks(CsmFile)
 7 sec (includes read of all included files)

- other Semantic HL:
org.netbeans.modules.cnd.highlight.semantic.SemanticHighlighter.update(BaseDocument, CsmReferenceRepository$Interrupter) 30 sec 
where 20 sec are spent in repository:
org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.get(Key) 20 sec


HLing the second file is much faster (< 1 sec)
Comment 5 Vladimir Voskresensky 2010-04-28 15:27:20 UTC
We can not do anything with I/O opening from repository except...
- put repository into RAM based disk (i.e. on Solaris and Ubuntu /tmp is mounted to swap which is in RAM)
start nb with   -J-Dcnd.repository.cache.path="/tmp/cnd/cache" to check if it can help
+
we are thinking to load cache on startup into memory mapped file => no need for redirecting as I propose above + /tmp is cleaned on restart of system, while usual place where userdir is kept - not => cache is kept vs. full reparse of project after restarting OS.
Comment 6 rmartins 2010-04-28 15:56:34 UTC
Created attachment 98214 [details]
Profile with tmp on disk
Comment 7 rmartins 2010-04-28 16:07:24 UTC
Created attachment 98215 [details]
Profile with tmp on ramdisk
Comment 8 Alexander Simon 2010-04-28 19:22:35 UTC
*** Bug 108853 has been marked as a duplicate of this bug. ***
Comment 9 Vladimir Voskresensky 2010-04-28 20:11:53 UTC
Rolando, can you attach nps files, not xml

Thanks!
Vladimir
Comment 10 Vladimir Voskresensky 2010-04-29 08:24:07 UTC
Created attachment 98253 [details]
disk profile
Comment 11 Vladimir Voskresensky 2010-04-29 08:25:08 UTC
Created attachment 98254 [details]
on ram disk
Comment 12 Vladimir Voskresensky 2010-04-29 08:30:22 UTC
(In reply to comment #11)
> Created an attachment (id=98254) [details]
> on ram disk

Parsing is not yet finished in this snapshot
Comment 13 rmartins 2010-04-29 13:41:52 UTC
Created attachment 98283 [details]
proper on ram disk
Comment 14 rmartins 2010-04-29 13:46:49 UTC
Created attachment 98286 [details]
profile parsing project - ram disk