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.
Build: NetBeans IDE 7.2 (Build 201207171143) VM: Java HotSpot(TM) 64-Bit Server VM, 23.1-b03, Java(TM) SE Runtime Environment, 1.7.0_05-b06 OS: Linux User Comments: wadechandler: I am in the PHP editor. I am on an empty new line. I press CTRL+SPACE. Long delay. Over and over I can make this happen it. The long delay varies, but it happens over and over. I have installed the updates. I have restarted. My Java editor does not do this. GUEST: editing PHP file Maximum slowness yet reported was 32350 ms, average is 25705
Created attachment 127141 [details] nps snapshot
This is in the full version of the IDE: JEE, PHP, C++, etc
(In reply to comment #2) > This is in the full version of the IDE: JEE, PHP, C++, etc And Scala as well. just my personal pet peeve.. have you tried killing (deleting) the ergonomicsX folder in netbeans installation? There doesn't seem to be a one specific problem at hand. PHP support through PhpSourcePath.getFileType() is querying Classpath for a file. that in turn invokes java and cls classpath providers which most likely iterate project. Then in Maven project types we get some slowness in lookup resolutions but it's unclear to me what could have caused that. Maybe some sort of synchronization issue. In 7.3 I've done some optimizations in project lookup construction, not sure if it has any significant measurable effect though. It's unclear to me why is all this happening in AWT thread, php guys want to comment on that?
how many projects do you have open at a time?
I use the project groups feature. So, in this case, I only have a single PHP project opened. I do have another group which I had opened prior to this one being opened which has maybe 20 projects in it with a good number of classes. Not sure if that could impact it. I'm restarting so that the PHP group opens first. Will update.
The blocking the EDT is really bad though. For instance, when I restarted, I see "Scanning in progress" and if I CTRL+SPACE, then I'm blocked until that project completes scanning, and too, it depends on the size of your PHP installation I guess. That on top of this other issue of completing hanging for a while. Code completion seems fine enough if I am not on an empty newline, but the UI blocking issue would come into play depending on the speed of the drive and other factors.
in 7.3 timeframe there is a change in how MavenFileOwnerQuery (class that links maven projects together via local repository paths) works within project groups. In 7.2 we persisted a global list of "known" projects, known being those at least once opened, or their parent pom project was opened. in 7.3 the setting became project group specific, each project group having it's own list of "known projects".
I should probably rephrase the last sentence. It is fine if say I type my| and where | is the cursor do a CTRL+SPACE. Were I to arrow up onto a line which has code, yet be in white space I still have the issue. On an empty new line, then the same. So (where _ is a space to allow showing the cursor): ______pr|int ''; fine (some where in the middle of real code) ___|___print ''; hangs (white space of a line with code) ____|_____ hangs (empty new line)
Restarting with just PHP project opened had the same exact affect. In other words, the project was opened when I closed, and was the only thing the IDE opened when I restarted. Does the issue you mentioned mean *ever opened* once or only per IDE run?
Seems strange this is only affected in the cases of white space. Perhaps there is some kind of passed in context or text which is checked and causes the logic to go down separate paths?
(In reply to comment #3) > It's unclear to me why is all this happening in AWT thread, php guys want to > comment on that? Ondra can explain, I guess. For NB 7.3, we changed the recognition of "file type" (source, include) for PHP to use ClassPath (otherwise we are not able to recognize INCLUDE file). I can optimize it in PHP but this seems to me to be a more general problem...
Adding Tomas to CC...
One more idea - how many PHP files do you have on your Global PHP Include Path?
Milos: that getRhsHtml method of php completion item is called from CSL, so csl calls it from AWT
(In reply to comment #9) > Restarting with just PHP project opened had the same exact affect. In other > words, the project was opened when I closed, and was the only thing the IDE > opened when I restarted. Does the issue you mentioned mean *ever opened* once > or only per IDE run? Ever. you can check the list in your config/Preferences/org/netbeans/modules/maven/externalOwners.properties file in netbeans user directory. if you delete it and restart the ide, you loose all your inter-project connections..
(In reply to comment #14) > Milos: that getRhsHtml method of php completion item is called from CSL, so csl > calls it from AWT so we reassign to CSL (whatever that is)? What is the component in bugzilla?
Editor/CSL
Milos: Got it. I think I will leave those for now then. I am just helping a NB user from the IRC chat out by tracking down some PHP issues he mentioned. I might check that out later or something to see how that behaves, but my main work is happening in Maven and Java right now :-) Tomas: As it relates to my include_path, php.ini says it defaults to the pear path, and it isn't set, so if I run: pear list then I see: Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.7 stable Benchmark 1.2.7 stable Console_Getopt 1.3.0 stable PEAR 1.9.4 stable Structures_Graph 1.0.4 stable XML_Util 1.2.1 stable This is my dev box, and I'm not really jamming on any PHP right now, and that really doesn't seem like a lot of packages necessarily. I can run an example and see what the install_path is set to at runtime though.
FileOwnerQuery should be fast enough to be called from EDT as all the project queries delegate to it. Not allowing it disables also the ClassPath, SFBQ, BSFQ, JFBQ, SLQ, etc. There is lots of code in project ui doing it.
This is Ubuntu 12.04 64-bit if that helps any.
Just noticed the ergonomicsx comment. I will try to move that off and see how it behaves. Will let you know if it helps at all.
The NB "Global Include Path" is blank btw.
Milos: Was looking at config/Preferences/org/netbeans/modules/maven/externalOwners.properties. That guy seems like it could get pretty big. Is there a limit placed on its size? Or does it just grow to the max size which will support a Properties instance? Curious side note.
(In reply to comment #22) > The NB "Global Include Path" is blank btw. Thanks, this is exactly what I have asked for (NetBeans does not know anything about your php.ini and does not use at all). Thanks.
I deleted the "ergnomics" directory under my 7.2 install and this had no effect on this issue.
Milos: Last thing I can think of out of the things I think that were mentioned. I tried to move off externalOwners.properties, and this seems to have had no effect either. Are any of you guys able to replicate with the full version of the IDE?
Not sure that the CSL is the right component. Moving the call outside the EDT does not solve the root cause the slow FileOwnerQuery.
I am rather against moving the computation off EDT in GSF. If RHS / LHS html strings are difficult to compute in PHP, then PHPCompletionItem should preinitialize them in the completion provider, so the calls are fast. And since they used from getPreferredSize(), they may be called pretty frequently. There's about 15,2secs of Maven Project implementation running out of 20secs of the reported slowness... so I am tempted to move the attribute the slowness to Maven support, but I'd wait for a confirming report from 7.3, since perf. optimizations have been made, according to Milos. The second fix candidate is IMHO PHP; the isPlatform() call result might be either precomputed directly in PHP Element during parsing or (as even getFileObject() is lazy) possibly when PHPCompletionProvider creates the CompletionElements. PHP owners, can it be done ?
(In reply to comment #28) > PHP owners, can it be done ? We could try to cache platform files themselves (these files are part of NetBeans); but the current code is: private static boolean isInternalFile(FileObject file) { for (FileObject dir : CommonPhpSourcePath.getInternalPath()) { if (dir.equals(file) || FileUtil.isParentOf(dir, file)) { return true; } } return false; } where CommonPhpSourcePath.getInternalPath() is already cached. Will it help? What do you think? I am not sure that we will improve something... Thanks.
Why adverse to taking it off the EDT? This seems a prime example of why it should be done. Unknown issues creep in in strange places and other modules. If the EDT is blocked then the IDE is u sable. Were it not this could be bearable.
So after discussion with Svata, we will move that isPlatform() call to CompletionItem constructor, which is not processed in AWT, but in CC thread, so AWT should not longer be blocked now.
So editor part is done web-main #6a54085bc220
On the other part, yes, there must be something in the maven module causing some long delays. I will see if I can replicate this in 7.3 full (everything enabled). If I can, then I will see if I can find some time to debug it with a daily hg grab. If I can't, then I will see if I can do the same with the 7.2.1 sources. I should be able to run that against my code and it shouldn't be any different than what is happening to me now as it relates to using the IDE. I will use the same userdir. Perhaps I can better pinpoint it.
I meant to say: Thank you for jumping on the EDT bits guys.
OK, setting as fixed, as both maven & processing in EDT were supposedly improved from 7.2. _wadechandler: please check the issue with 7.3dev build, when the fix becomes available. Reopen and attach a fresh profiler snapshot if necessary; thanks.
Integrated into 'main-golden', will be available in build *201211090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6a54085bc220 User: Ondrej Brejla <obrejla@netbeans.org> Log: #221482 - Long delay with PHP editor code completion