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 27785 - Character typing in the editor has to be fast
Summary: Character typing in the editor has to be fast
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL: http://performance.netbeans.org/respo...
Keywords: PERFORMANCE
Depends on: 13768 27783 28393 28537
Blocks: 26581 34161
  Show dependency tree
 
Reported: 2002-10-03 16:26 UTC by _ rkubacki
Modified: 2007-11-05 13:44 UTC (History)
5 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Profile: auto completion initializes JDP too early (6.83 KB, text/plain)
2002-10-31 17:30 UTC, _ pkuzel
Details
Profile: auto completion initializes JDP too early (6.83 KB, text/plain)
2002-10-31 17:33 UTC, _ pkuzel
Details
A fix that lazy initializes JDP (1.62 KB, patch)
2002-10-31 18:15 UTC, _ pkuzel
Details | Diff
Synchronous document listener consequence (4.92 KB, text/plain)
2002-11-29 19:32 UTC, _ pkuzel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2002-10-03 16:26:41 UTC
Beginning of action: Press keyboard key
Completion: Character appears in editor
Maximum time allowed: 100 ms
Comment 1 Jan Lahoda 2002-10-04 10:01:37 UTC
Hi,
    do you have any clue that this takes *more* than 100ms? Please,
note this:
1. The machine tested (processor, frequency, memory (RAM), OS, JDK
version) will make big difference. 
2. There are some freezes during typing, but these are caused by
garbage collector. I am not aware about any way that editor itself can
prevent this.

Please, provide more info about where it tooke more that 100ms, and why.
Comment 2 _ pkuzel 2002-10-25 18:37:01 UTC
Every keystroke in java editor launches background operation (batched):
  100ms  looking for matching bracket
  200ms  updating caret position
  1000ms updating toolbar combo
         setSelectedNode() -> 200ms property sheet
                                    update

These operations must be checked for garbage production.
Comment 3 _ pkuzel 2002-10-31 17:30:53 UTC
Created attachment 7826 [details]
Profile: auto completion initializes JDP too early
Comment 4 _ pkuzel 2002-10-31 17:33:28 UTC
Created attachment 7827 [details]
Profile: auto completion initializes JDP too early
Comment 5 _ pkuzel 2002-10-31 18:15:24 UTC
Created attachment 7828 [details]
A fix that lazy initializes JDP
Comment 6 _ pkuzel 2002-10-31 20:47:28 UTC
Eliminating issue 13768 will help in 
autocompletion check case. 
Comment 7 _ pkuzel 2002-11-06 11:35:50 UTC
I instrumented Completion class and observed four completion events
per typed character:

ENTRY insertUpdate
ENTRY completionCancel
ENTRY caretUpdate
ENTRY cancelRequest

quite complicated... 

I'll simplify it.
Comment 8 _ pkuzel 2002-11-06 16:18:37 UTC
completionCancel call eliminated by adding a fast check to
CompletionJavaDoc caret listener implementation.
Comment 9 Marian Mirilovic 2002-11-22 10:00:46 UTC
Marian's measurement (time in milliseconds):
conditions: 
 - SUN UltraSparc60 / 512 MB RAM / Solaris 5.8 / CDE
 - JDK1.4.1(01)
 - [nb_dev](200211140100) , MDI
        - mounted sampledir

type a character in the editor
		12      9       20

Test cases described on page :
http://performance.netbeans.org/qa/TestSuites.html#type_a_character_in_editor
Comment 10 Tomas Pavek 2002-11-22 15:23:03 UTC
Not sure how to measure this - if such simple and isolated measuring
is enough...
Comment 11 _ pkuzel 2002-11-29 19:32:14 UTC
Created attachment 8118 [details]
Synchronous document listener consequence
Comment 12 _ pkuzel 2002-11-29 19:40:11 UTC
DocumentListener JavaDoc: The DocumentEvent notification is based upon
the JavaBeans event model. There is no guarantee about the order of
delivery to listeners, and all listeners must be notified prior to
making further mutations to the Document. This means implementations
of the DocumentListener may not mutate the source of the event (i.e.
the associated Document).

It means that keytyping may be blocked by any handler. Unfortunatelly
handlers are unknown to editor module. Expensive handler of keytype
DocumentEvent is attached.
Comment 13 _ pkuzel 2003-01-20 15:00:47 UTC
Tim could you add -J-XX:+UseConcMarkSweepGC to core/release/ide.cfg.
AFAIK we concluded that it is harmless for old JVMs. On recent JVMs it
solves latency problems (that hurts editor a lot).
Comment 14 Tomas Pavek 2003-01-29 17:49:18 UTC
Does not seem to be harmless. JVM crashes with
-J-XX:+UseConcMarkSweepGC on JDK 1.4.0 on my machine (Win2K).
Comment 15 _ tboudreau 2003-01-30 09:40:34 UTC
All of the measurements I made back in the fall showed 
UseConcMarkSweepGC to be considerably slower, and I've also
had stability problems when using it.
Comment 16 _ pkuzel 2003-01-30 10:38:34 UTC
Considerably slower? Does it influenced responsiveness? Is it too
intrusive?

I have possitive experience with it on Linux -Xverbose:gc showed that
it never blocks JVM in stop the world manner for more than 200ms
comparing to default 700ms-15000ms.
Comment 17 _ tboudreau 2003-01-30 11:42:45 UTC
Adding Dafe to cc list, since I know he had some problems with
this setting too.  My experience with it on Solaris was that the
IDE was nearly unusably slow.
Comment 18 _ pkuzel 2003-01-30 12:43:38 UTC
Another negative experience from mailing list:

Thomas Kellerer <spam_eater@gmx.net> wrote:
Keep an eye on your memory consumption. With W2K and JDK 1.4.1 this
option sharply increased NB's memory consumption so I stopped using it
(about 400MB after 1-2 hours, without that option it's about 100MB
after that time).

Does 1.4.2 address it?
Comment 19 _ pkuzel 2003-02-05 14:49:57 UTC
It's a kind of umbrella issue. Targeted to >=M3.
Comment 20 Tomas Pavek 2003-03-03 14:41:02 UTC
We did what we did ... closing as fixed. Please eneter separate issues
if some problem remain.