Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 211466 - Slow code completion in groovy
Slow code completion in groovy
Status: RESOLVED FIXED
Product: groovy
Classification: Unclassified
Component: Editor
7.2
PC Mac OS X
: P2 (vote)
: 7.2
Assigned To: Tomas Zezula
issues@groovy
: PERFORMANCE
: 210597 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-19 14:14 UTC by Tomas Zezula
Modified: 2012-04-23 11:57 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2012-04-19 14:14:26 UTC
Created as a split of issue #180230, see issue #180230 for details.

<cite>
Looks like the Groovy sources were parsed on CC. It is not clear from the
thread dump whether is was valid (=> performance problem) or invalid (=> some
defect in parsing cache).
</cite>
Comment 1 Tomas Zezula 2012-04-19 19:10:55 UTC
Seems that the groovy index contains all necessary information for code completion, it contains all elements.

Here is an example of a class document:

stored,indexed,omitNorms<_sn:graduate/GraZsfRxkskcxxController.groovy>
stored,indexed,omitNorms<class:GraZsfRxkskcxxController>
stored,indexed,omitNorms<class-ig:grazsfrxkskcxxcontroller>
stored,indexed,omitNorms<field:update;java.lang.Object;00;true>
stored,indexed,omitNorms<field:index;java.lang.Object;00;true>
stored,indexed,omitNorms<field:save;java.lang.Object;00;true>
stored,indexed,omitNorms<field:delete;java.lang.Object;00;true>
stored,indexed,omitNorms<field:edit;java.lang.Object;00;true>
stored,indexed,omitNorms<field:list;java.lang.Object;00;true>
stored,indexed,omitNorms<field:allowedMethods;java.lang.Object;00;true>
stored,indexed,omitNorms<field:show;java.lang.Object;00;true>
stored,indexed,omitNorms<field:create;java.lang.Object;00;true>
stored,indexed,omitNorms<fqn:graduate.GraZsfRxkskcxxController>
stored,indexed,omitNorms<method:getIndex;java.lang.Object>
stored,indexed,omitNorms<method:setIndex(java.lang.Object);void>
stored,indexed,omitNorms<method:getAllowedMethods;java.lang.Object>
stored,indexed,omitNorms<method:setAllowedMethods(java.lang.Object);void>
stored,indexed,omitNorms<method:getList;java.lang.Object>
stored,indexed,omitNorms<method:setList(java.lang.Object);void>
stored,indexed,omitNorms<method:getShow;java.lang.Object>
stored,indexed,omitNorms<method:setShow(java.lang.Object);void>
stored,indexed,omitNorms<method:getDelete;java.lang.Object>
stored,indexed,omitNorms<method:setDelete(java.lang.Object);void>
stored,indexed,omitNorms<method:getEdit;java.lang.Object>
stored,indexed,omitNorms<method:setEdit(java.lang.Object);void>
stored,indexed,omitNorms<method:getUpdate;java.lang.Object>
stored,indexed,omitNorms<method:setUpdate(java.lang.Object);void>
stored,indexed,omitNorms<method:getCreate;java.lang.Object>
stored,indexed,omitNorms<method:setCreate(java.lang.Object);void>
stored,indexed,omitNorms<method:getSave;java.lang.Object>
stored,indexed,omitNorms<method:setSave(java.lang.Object);void>

so the problem seems to be in parsing and resolution in single file.
Comment 2 Tomas Zezula 2012-04-19 19:26:11 UTC
The problem is in how the GroovyParser uses JavacParser + GroovyClassLoaders for attribution.
I've add a caching into JavacParser which should help the GroovyParser, it's much simpler to do it in JavacParser compared to doing the caching in the GroovyParser. This should help both indexing and code completion. With the patch I've tried the code completion in  mid size project and it took seconds rather than tens of seconds.
Fixed jet-main c7e4711635d2.

As my Groovy knowledge is nearly none, I am a Scala boy ;-) it would be good if someone who knows Groovy can try it when it gets into dev build, this may take some time.
Thanks
Comment 3 Martin Janicek 2012-04-23 11:57:05 UTC
*** Bug 210597 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo