Question on Java, performance issue

E

Erik Hentell

Hi,

I'm trying to clear up some confusion on my part regarding Java's
desktop performance. Some months back I was working for a small
company that ran exclusively on Windows systems. My particular
workstation was running Win2k SP2. Whenever I tried to do something
with Java, one of two things would happen: if I was viewing an applet,
the browser I was using (Firefox, IE, didn't matter) would lock up and
become totally unresponsive until the applet loaded. If I downloaded
a Java application (or used Web Start), I'd have to wait what seemed
like an eternity before anything actually appeared on the screen,
ready to use.

I've since moved to another company, where we all use Mac OS X. Java
is heavily integrated with OS X, so everything runs smoothly. Still,
from my previous job I didn't have the best impression of Java. A
coworker, though, insisted something must have been wrong with my
system. I'm not so sure, but I figured this would be the best forum
to ask. I'm not sure what further details I could provide, but if
someone could let me know whether my case is unusual or common, I'd
appreciate it.

Much thanks,
Erik
 
M

Michael Borgwardt

Erik said:
I'm trying to clear up some confusion on my part regarding Java's
desktop performance. Some months back I was working for a small
company that ran exclusively on Windows systems. My particular
workstation was running Win2k SP2. Whenever I tried to do something
with Java, one of two things would happen: if I was viewing an applet,
the browser I was using (Firefox, IE, didn't matter) would lock up and
become totally unresponsive until the applet loaded. If I downloaded
a Java application (or used Web Start), I'd have to wait what seemed
like an eternity before anything actually appeared on the screen,
ready to use.

I've since moved to another company, where we all use Mac OS X. Java
is heavily integrated with OS X, so everything runs smoothly. Still,
from my previous job I didn't have the best impression of Java. A
coworker, though, insisted something must have been wrong with my
system. I'm not so sure, but I figured this would be the best forum
to ask. I'm not sure what further details I could provide, but if
someone could let me know whether my case is unusual or common, I'd
appreciate it.

Your coworker was right. Java needs no integration with the OS to
achieve good performance, on OS X it's probably just a GUI thing.
There must have been something seriously wrong with the java
installation on your previous system.
 
D

Dimitri Maziuk

Erik Hentell sez:
...
I'm not sure what further details I could provide, but if
someone could let me know whether my case is unusual or common, I'd
appreciate it.

OS X is a time-sharing OS (or, rather, has one hidden inside).
Winders began with cooperative multitasking. The difference is
that in the first one OS gives every program its fair share of
CPU cycles, in the second a program executes until *it decides*
to yield te CPU.

NT and its successors are not supposed to do coop. MT anymore
(however M$ is not telling exactly what they do), but I still
see 100% CPU allocated to foreground application/thread (and
other apps/threads appear to be frozen) every now and again.
Esp. with VB and sometimes Java programs.

This isn't unreasonable on a single-user desktop system --
the foreground application is the one actually being used so
it makes sense to give it more CPU time. (IIRC there's a
"performance boost for foreground application" setting
somewhere that should affect this.)

Dima
 
S

Steve W. Jackson

Michael Borgwardt said:
:Erik Hentell wrote:
:> I'm trying to clear up some confusion on my part regarding Java's
:> desktop performance. Some months back I was working for a small
:> company that ran exclusively on Windows systems. My particular
:> workstation was running Win2k SP2. Whenever I tried to do something
:> with Java, one of two things would happen: if I was viewing an applet,
:> the browser I was using (Firefox, IE, didn't matter) would lock up and
:> become totally unresponsive until the applet loaded. If I downloaded
:> a Java application (or used Web Start), I'd have to wait what seemed
:> like an eternity before anything actually appeared on the screen,
:> ready to use.
:>
:> I've since moved to another company, where we all use Mac OS X. Java
:> is heavily integrated with OS X, so everything runs smoothly. Still,
:> from my previous job I didn't have the best impression of Java. A
:> coworker, though, insisted something must have been wrong with my
:> system. I'm not so sure, but I figured this would be the best forum
:> to ask. I'm not sure what further details I could provide, but if
:> someone could let me know whether my case is unusual or common, I'd
:> appreciate it.
:
:Your coworker was right. Java needs no integration with the OS to
:achieve good performance, on OS X it's probably just a GUI thing.
:There must have been something seriously wrong with the java
:installation on your previous system.

I concur. I'm a Mac OS X user for my personal system, and the Java
integration basically means that Apple has included Java with Mac OS X
from the beginning. It's also got all the needed "hooks" to take
advantage of the OS X Aqua interface.

Java has a history of getting accused of poor performance, and it's not
really true. My work with Java is almost entirely limited to Windows
and Linux, since that's where my company product is presently supported.
The kind of slow startup you describe is, in my experience, nearly
always the result of (1) poor design, or (2) some serious configuration
or system issue.

= Steve =
 
F

FISH

Hi, [snipped...]

I've since moved to another company, where we all use Mac OS X. Java
is heavily integrated with OS X, so everything runs smoothly. Still,
from my previous job I didn't have the best impression of Java. A
coworker, though, insisted something must have been wrong with my
system. I'm not so sure, but I figured this would be the best forum
to ask. I'm not sure what further details I could provide, but if
someone could let me know whether my case is unusual or common, I'd
appreciate it.


We have Java installed on a number of Windows (XP mainly, but some
older versions) and Linux machines. It starts reasonably quickly on
all, even on slower equipment. However there is one machine in the
office which takes an age to start up Java - often two minutes or
more. It's a 'spare' PC, home to stuff like high-res scanner, CD-ROM
labeler and a Zip drive, which often gets used to tranfer stuff on/off
the network, and as a test/'scratch' machine. Because of this its
virus checker has been set to be ultra strict. I've noticed that
opening large Zip files is slow too - so I can only assume that the
anti-virus scanner is stopping to inspect every file in an archive
before it will let it pass. For a Swing application, this is going
to take a loooooong time! (Although the delay is only on the first
execution after a re-boot, so presumably the results are cached.)


-FISH- ><>
 
C

Chris Smith

Dimitri said:
NT and its successors are not supposed to do coop. MT anymore
(however M$ is not telling exactly what they do),

Maybe you're just not listening. Windows NT, 95, and all successors
provide pre-emptive multitasking, and implements a straight-forward
scheduling algorithm: priorities are absolute, and threads are round-
robin within priorities. Boosting the foreground application is
accomplished by lengthening its quantum. This is much simpler than
other operating systems (notably UNIX, which its "nice" scheme), and you
may have confused the simplicity for lack of information.
but I still
see 100% CPU allocated to foreground application/thread (and
other apps/threads appear to be frozen) every now and again.
Esp. with VB and sometimes Java programs.

As a guess, this is more likely to be related to VM than CPU scheduling.
If a process is swapping, then it explcitly refuses CPU time, which is
then likely to be allocated to separate task that requires that CPU.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
M

Michael Borgwardt

Steve said:
The kind of slow startup you describe is, in my experience, nearly
always the result of (1) poor design, or (2) some serious configuration
or system issue.

I strongly suspect that FISH is right: an overzealous/badly configured
virus scanner that checks all class files would have exactly the results
Erik describes.
 
D

Dimitri Maziuk

Chris Smith sez:
Maybe you're just not listening. Windows NT, 95, and all successors
provide pre-emptive multitasking, and implements a straight-forward
scheduling algorithm: priorities are absolute, and threads are round-
robin within priorities. Boosting the foreground application is
accomplished by lengthening its quantum. This is much simpler than
other operating systems (notably UNIX, which its "nice" scheme), and you
may have confused the simplicity for lack of information.

Riight. Ever used VB (5 is the one I've used) on any of those?
I guess "lengthening its quantum to the time required for app
to run to completion" is one way of describing it.
As a guess, this is more likely to be related to VM than CPU scheduling.
If a process is swapping, then it explcitly refuses CPU time, which is
then likely to be allocated to separate task that requires that CPU.

Yeah. As is "the system is not frozen, it just swapped out mouse
interrupt handler to make room for JVM".

Dima
--

.... If you want to make sure you don't put a Pig in a List of airplanes and
have it fail at insertion rather than extraction, use
planelist.add((Airplane)o) instead of planelist.add(o). It's that easy.
-- Mark 'Kamikaze' Hughes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,790
Messages
2,569,637
Members
45,348
Latest member
RoscoeNevi

Latest Threads

Top