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 19948 - Reduce the number of threads created by the RequestProcessor
Summary: Reduce the number of threads created by the RequestProcessor
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P2 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2002-01-30 15:16 UTC by Petr Nejedly
Modified: 2008-12-23 13:48 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2002-01-30 15:16:44 UTC
Widespread of the private RP usage caused enormous growth of the threads
the IDE runs (currently about 22 RP threads for a standard IDE).
Reimplement the RP to share unused threads to reduce memory usage
and help the OS scheduler.
As a nice side effert, it will also remove most of the redundant
stuff from the ThreadDumps.
It would be nice if we could reuse java.util.Timer for the schadling part.
Comment 1 Petr Nejedly 2002-01-30 15:19:54 UTC
It may also help people with solving some of the threading issues
and help the Actions API with posting independent performers
by implementing Annonymous RP (a generally paralelizing RP)
Comment 2 Petr Nejedly 2002-02-15 09:42:02 UTC
It would also allow even greater adoption of private RPs
in modules and reduce the usage of the shared RP.DEFAULT
which slows down e.g. explorer folder expansions (used there
at several places throughout the folder expansion process)
Comment 3 Jesse Glick 2002-03-01 10:05:27 UTC
Consider also:

- do not call Thread.setPriority unless really necessary, it is a
native call and may be expensive

- do not create a stack trace for the "posting time" unless a system
property is set explicitly asking for it; these stack traces are often
unnecessary to diagnose a problem, and they slow down every RP request
posting
Comment 4 Petr Nejedly 2002-03-04 16:30:51 UTC
> do not call Thread.setPriority unless really necessary, it is a
> native call and may be expensive
Mmm, it takes about 3-4us on my machine, not that bad,
but a simple wrapper caching the old priority and skipping
setPriority call on 100:1 hit sped it up to 0.3-0.4us, so
I'll do the old priority caching.

> do not create a stack trace for the "posting time" unless a system
> property is set explicitly asking for it;
Till now the logic was opposite (keep traces by default), 
should I revert it now?

BTW: it takes some tens of us for each request.
Comment 5 Petr Nejedly 2002-03-14 11:19:49 UTC
Implemented in
/cvs/openide/src/org/openide/util/RequestProcessor.java,v 1.55

Also implemented less confusing exception reporting.
Comment 6 Jan Zajicek 2002-04-05 15:53:23 UTC
More than 3 weeks in the trunk builds without any significant
problems. No more 22 RP in my VM ;-) Also exceptions reportring is
more clear now. Verifying.