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 122012 - low performance of completion
Summary: low performance of completion
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 108501
  Show dependency tree
 
Reported: 2007-11-15 14:31 UTC by Alexander Simon
Modified: 2009-11-02 11:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
too long UI freezing (1.62 KB, text/plain)
2007-11-15 14:33 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2007-11-15 14:31:55 UTC
low performance visualization of the completion results
Comment 1 Alexander Simon 2007-11-15 14:33:19 UTC
Created attachment 53047 [details]
too long UI freezing
Comment 2 Alexander Simon 2007-11-15 14:42:24 UTC
Projects in C style can have more then 100`000 items in the default namespace.
IDE should provide way to fast showing of completion results.
Now IDE is preparing result about 3 seconds and showing about 30 seconds.
UI is freezing.
Comment 3 Alexander Pepin 2007-11-16 15:24:16 UTC
See also issue #108853
Comment 4 Alexander Pepin 2007-11-16 15:28:01 UTC
please ignore "see also" that has nothing to do with the issue.
Comment 5 Dusan Balek 2007-11-20 10:46:04 UTC
Could you please provide me with an exmaple project and exact steps to reproduce? I've just tried to reproduce the
problem on a simple C++ project and the code completion perfomance was fine (I would say - better than we have in Java).

Otherwise, showing more than 100 000 items in the code completion is IMHO useless. In this situation, user always has to
type more characters to narrow the result list down to some reasonable size (just to be able to find the requested item
in the list). Please, consider using some alternative approach in this situation.
Comment 6 Alexander Simon 2007-11-20 13:13:38 UTC
Sample of project and steps to repeat.
1. Download Open Solaris sources on-src.tar.bz2.
(For example from http://dlc.sun.com/osol/on/downloads/b77/)
2. Unpack
3. Start IDE with -J-Xmx1300M
3. Create new C/C++ project from existing code
4. Wait parsing.
5. Try second code completion.
Comment 7 Vladimir Voskresensky 2007-12-12 15:21:21 UTC
As discussed: 
#1 prevent sort
#2 prevent displaying on items

re #1 in fact we can not skip this phase, because quick sort is really "quick" on sorted collections (just O(n)) and no
reasons to introduce additional complexity for SPI implementers
re #2 infrastructure introduce method for SPI implementers CompletionResultSet.setHideExtraItems(boolean). SPI
implementers put all it's items in result set and call this method.
If none of providers set flag => threshold is the number of all items.
Infrastructure sorts all items and after sorting will display only threshold elements and item "More..." as the last
item (in case of flag ON). All calculations are done based on this threshold elements. 
Comment 8 Petr Dvorak 2008-07-09 10:29:11 UTC
I am removing the INCOMPLETE keyword as I think the issue description is not incomplete at the moment...
Comment 9 Jan Becicka 2008-08-07 10:03:37 UTC
We use Ctrl-Space, Ctrl-Space for 2 level completion. It should work for C++ as well. Is this issue still for editor?
Comment 10 Vladimir Voskresensky 2008-08-07 10:55:15 UTC
yes, for C++ two modes of completion is in place as well.

but issues still exists (displaying phase takes huge amount of time), so we implemented by ourselves 
#2 prevent displaying all items
we do not pass full our list to completion infrastructure, but only N items + fake item "And more..."
when use types more symbols => filtering is done on our side and we again pass only N + fake item if still needed

I can downgrade to P4 if you'd like
Comment 11 Dusan Balek 2008-11-18 10:26:38 UTC
Should be resolved later
Comment 12 Quality Engineering 2009-11-02 11:03:15 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX