Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java application developped under Linux running ridiculously slow under Windows

Reply
Thread Tools

Java application developped under Linux running ridiculously slow under Windows

 
 
hshdude
Guest
Posts: n/a
 
      10-24-2004
Hi,

I have been working with a time-criticial application written in Java by my
predecessors in the lab. It's a server that keeps track of objects running
around in real time, with clients connecting via TCP/IP to get information
about those objects. The clients can then display that information in
various (mostly graphical) ways and send requests to the server for a
particular object to change its behavior (e.g. speed). Clients and server
initially ran in separate processes, but now run as separate threads within
the same process (in a largely unsuccessful attempt to speed things up).

The application has so far only been used under Linux but now the need arose
for it to be runnable under Windows. Running it isn't really the problem,
the problem is the speed with which it runs. There aren't any hard
computations involved and it runs much slower on Windows than on Linux even
when run on the same (physical) machine, to the extent that it's unusable as
it need to run in real time. Does anyone have any idea what might be going
on here?

Thanks in advance

cheers,
Arnold


[I'm posting this on three groups at the same time that seem relevant.]


 
Reply With Quote
 
 
 
 
Michael Borgwardt
Guest
Posts: n/a
 
      10-24-2004
hshdude wrote:
> The application has so far only been used under Linux but now the need arose
> for it to be runnable under Windows. Running it isn't really the problem,
> the problem is the speed with which it runs. There aren't any hard
> computations involved and it runs much slower on Windows than on Linux even
> when run on the same (physical) machine, to the extent that it's unusable as
> it need to run in real time. Does anyone have any idea what might be going
> on here?


There are programs called profilers that tell you exactly where an application
spends its time. Get one of these and use it.

Guesswork is a very bad basis for performance tuning.
 
Reply With Quote
 
 
 
 
Ann
Guest
Posts: n/a
 
      10-25-2004

"hshdude" <(E-Mail Removed)> wrote in message
news:clha9q$itk$(E-Mail Removed)...
> Hi,
>
> I have been working with a time-criticial application written in Java by

my
> predecessors in the lab. It's a server that keeps track of objects

running
> around in real time, with clients connecting via TCP/IP to get information
> about those objects. The clients can then display that information in
> various (mostly graphical) ways and send requests to the server for a
> particular object to change its behavior (e.g. speed). Clients and server
> initially ran in separate processes, but now run as separate threads

within
> the same process (in a largely unsuccessful attempt to speed things up).
>
> The application has so far only been used under Linux but now the need

arose
> for it to be runnable under Windows. Running it isn't really the problem,
> the problem is the speed with which it runs. There aren't any hard
> computations involved and it runs much slower on Windows than on Linux

even
> when run on the same (physical) machine, to the extent that it's unusable

as
> it need to run in real time. Does anyone have any idea what might be

going
> on here?
>
> Thanks in advance
>
> cheers,
> Arnold
>
>
> [I'm posting this on three groups at the same time that seem relevant.]
>


Does it use threads? The implementation of threads is different I believe.



 
Reply With Quote
 
hshdude
Guest
Posts: n/a
 
      10-25-2004

"Ann" <(E-Mail Removed)> wrote in message
news:tvXed.242580$wV.75588@attbi_s54...
>
> "hshdude" <(E-Mail Removed)> wrote in message
> news:clha9q$itk$(E-Mail Removed)...
> > Hi,
> >
> > I have been working with a time-criticial application written in Java by

> my
> > predecessors in the lab. It's a server that keeps track of objects

> running
> > around in real time, with clients connecting via TCP/IP to get

information
> > about those objects. The clients can then display that information in
> > various (mostly graphical) ways and send requests to the server for a
> > particular object to change its behavior (e.g. speed). Clients and

server
> > initially ran in separate processes, but now run as separate threads

> within
> > the same process (in a largely unsuccessful attempt to speed things up).
> >
> > The application has so far only been used under Linux but now the need

> arose
> > for it to be runnable under Windows. Running it isn't really the

problem,
> > the problem is the speed with which it runs. There aren't any hard
> > computations involved and it runs much slower on Windows than on Linux

> even
> > when run on the same (physical) machine, to the extent that it's

unusable
> as
> > it need to run in real time. Does anyone have any idea what might be

> going
> > on here?
> >
> > Thanks in advance
> >
> > cheers,
> > Arnold
> >
> >
> > [I'm posting this on three groups at the same time that seem relevant.]
> >

>
> Does it use threads? The implementation of threads is different I believe.


Yes, it does use threads. Originally I had a separate process run for each
client. Due to the slow performance I changed it so that there is one
single process with several threads for the server and all the clients.
That didn't seem to speed things up much though.


 
Reply With Quote
 
hshdude
Guest
Posts: n/a
 
      10-25-2004

"Michael Borgwardt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hshdude wrote:
> > The application has so far only been used under Linux but now the need

arose
> > for it to be runnable under Windows. Running it isn't really the

problem,
> > the problem is the speed with which it runs. There aren't any hard
> > computations involved and it runs much slower on Windows than on Linux

even
> > when run on the same (physical) machine, to the extent that it's

unusable as
> > it need to run in real time. Does anyone have any idea what might be

going
> > on here?

>
> There are programs called profilers that tell you exactly where an

application
> spends its time. Get one of these and use it.
>
> Guesswork is a very bad basis for performance tuning.


Thanks, I'll look into that!


 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      10-25-2004
In article <(E-Mail Removed)>,
Michael Borgwardt <(E-Mail Removed)> wrote:

> hshdude wrote:
> > The application has so far only been used under Linux but now the need arose
> > for it to be runnable under Windows. Running it isn't really the problem,
> > the problem is the speed with which it runs. There aren't any hard
> > computations involved and it runs much slower on Windows than on Linux even
> > when run on the same (physical) machine, to the extent that it's unusable as
> > it need to run in real time. Does anyone have any idea what might be going
> > on here?

>
> There are programs called profilers that tell you exactly where an application
> spends its time. Get one of these and use it.
>
> Guesswork is a very bad basis for performance tuning.


Indeed. You should also examine your Windows system when the Java
program _isn't_ running. Check specifically for visues, adware and
similar resource draining malware.

--
John
----
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/
 
Reply With Quote
 
Chas Douglass
Guest
Posts: n/a
 
      10-25-2004
"hshdude" <(E-Mail Removed)> wrote in
news:clhoq5$16v$(E-Mail Removed):

>
> "Ann" <(E-Mail Removed)> wrote in message
> news:tvXed.242580$wV.75588@attbi_s54...
>>
>> "hshdude" <(E-Mail Removed)> wrote in message
>> news:clha9q$itk$(E-Mail Removed)...
>> > Hi,
>> >
>> > I have been working with a time-criticial application written in
>> > Java by

>> my
>> > predecessors in the lab. It's a server that keeps track of objects

>> running
>> > around in real time, with clients connecting via TCP/IP to get

> information
>> > about those objects. The clients can then display that information
>> > in various (mostly graphical) ways and send requests to the server
>> > for a particular object to change its behavior (e.g. speed).
>> > Clients and

> server
>> > initially ran in separate processes, but now run as separate
>> > threads

>> within
>> > the same process (in a largely unsuccessful attempt to speed things
>> > up).
>> >
>> > The application has so far only been used under Linux but now the
>> > need

>> arose
>> > for it to be runnable under Windows. Running it isn't really the

> problem,
>> > the problem is the speed with which it runs. There aren't any hard
>> > computations involved and it runs much slower on Windows than on
>> > Linux

>> even
>> > when run on the same (physical) machine, to the extent that it's

> unusable
>> as
>> > it need to run in real time. Does anyone have any idea what might
>> > be

>> going
>> > on here?
>> >
>> > Thanks in advance
>> >
>> > cheers,
>> > Arnold
>> >
>> >
>> > [I'm posting this on three groups at the same time that seem
>> > relevant.]
>> >

>>
>> Does it use threads? The implementation of threads is different I
>> believe.

>
> Yes, it does use threads. Originally I had a separate process run for
> each client. Due to the slow performance I changed it so that there
> is one single process with several threads for the server and all the
> clients. That didn't seem to speed things up much though.
>
>


Which is a prime example of "premature optimization".

Such a refactor could be expected to improve performance IF the problem
POSSIBLY might have had to do with insufficient memory (SOME
implementations of threads will use less memory than separate processes)
or MAYBE communication (SOME implementations of thread/thread
communcations are faster than SOME implementations of process/process),
or process start time versus thread start time, or whatever.

Take this is a lesson that shooting in the dark rarely hits the target.
Get some illumination on the problem before trying again to solve it.

Sorry to rag on you -- I've been beat up so many times to optimize before
we know where the problem is, so I get a little heated.

Chas Douglass
 
Reply With Quote
 
Matthias Ernst
Guest
Posts: n/a
 
      10-26-2004
"hshdude" <(E-Mail Removed)> wrote in message news:<clhor1$175$(E-Mail Removed)>...
> "Michael Borgwardt" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...


> > There are programs called profilers that tell you exactly where an

> application
> > spends its time. Get one of these and use it.

>
> Thanks, I'll look into that!


While in the end the output may be very nice, I always find profilers
a little difficult to set up. I mostly use poor man's sampling: hit
CTRL-break (Windows) / CTRL-Backslash (UNIX) repeatedly to get some
thread dumps (with many threads, these will be long). Often it's easy
to tell where the bottleneck is. If you still have no idea after a
minute, then go get a profiler ...

Matthias
 
Reply With Quote
 
Ed Elud
Guest
Posts: n/a
 
      10-26-2004
You might also want to take a good look at your application startup
memory settings (heap size) - if you're not using any, then, it is
possible that a default is being applied - which maybe causing garbage
collection issues, etc. Also, by default, Windoze generally splits
memory allocation around 40/60 to 60/40 in RAM and the other in
Virtual Memory - often without much regard to total available memory.
Thats often why you can increase memory on an Windoze system and not
notice exponential application speed.

Mind you, these are generalizations which I have found to be mostly
true.

Hope this helps.


Chas Douglass <(E-Mail Removed)> wrote in message news:<Xns958D87759A6F9cdouglasoznet@216.168.3.30>. ..
> "hshdude" <(E-Mail Removed)> wrote in
> news:clhoq5$16v$(E-Mail Removed):
>
> >
> > "Ann" <(E-Mail Removed)> wrote in message
> > news:tvXed.242580$wV.75588@attbi_s54...
> >>
> >> "hshdude" <(E-Mail Removed)> wrote in message
> >> news:clha9q$itk$(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > I have been working with a time-criticial application written in
> >> > Java by

> my
> >> > predecessors in the lab. It's a server that keeps track of objects

> running
> >> > around in real time, with clients connecting via TCP/IP to get

> information
> >> > about those objects. The clients can then display that information
> >> > in various (mostly graphical) ways and send requests to the server
> >> > for a particular object to change its behavior (e.g. speed).
> >> > Clients and

> server
> >> > initially ran in separate processes, but now run as separate
> >> > threads

> within
> >> > the same process (in a largely unsuccessful attempt to speed things
> >> > up).
> >> >
> >> > The application has so far only been used under Linux but now the
> >> > need

> arose
> >> > for it to be runnable under Windows. Running it isn't really the

> problem,
> >> > the problem is the speed with which it runs. There aren't any hard
> >> > computations involved and it runs much slower on Windows than on
> >> > Linux

> even
> >> > when run on the same (physical) machine, to the extent that it's

> unusable
> as
> >> > it need to run in real time. Does anyone have any idea what might
> >> > be

> going
> >> > on here?
> >> >
> >> > Thanks in advance
> >> >
> >> > cheers,
> >> > Arnold
> >> >
> >> >
> >> > [I'm posting this on three groups at the same time that seem
> >> > relevant.]
> >> >
> >>
> >> Does it use threads? The implementation of threads is different I
> >> believe.

> >
> > Yes, it does use threads. Originally I had a separate process run for
> > each client. Due to the slow performance I changed it so that there
> > is one single process with several threads for the server and all the
> > clients. That didn't seem to speed things up much though.
> >
> >

>
> Which is a prime example of "premature optimization".
>
> Such a refactor could be expected to improve performance IF the problem
> POSSIBLY might have had to do with insufficient memory (SOME
> implementations of threads will use less memory than separate processes)
> or MAYBE communication (SOME implementations of thread/thread
> communcations are faster than SOME implementations of process/process),
> or process start time versus thread start time, or whatever.
>
> Take this is a lesson that shooting in the dark rarely hits the target.
> Get some illumination on the problem before trying again to solve it.
>
> Sorry to rag on you -- I've been beat up so many times to optimize before
> we know where the problem is, so I get a little heated.
>
> Chas Douglass

 
Reply With Quote
 
Tim Jowers
Guest
Posts: n/a
 
      10-26-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Matthias Ernst) wrote in message news:<(E-Mail Removed). com>...
> "hshdude" <(E-Mail Removed)> wrote in message news:<clhor1$175$(E-Mail Removed)>...
> > "Michael Borgwardt" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...

>
> > > There are programs called profilers that tell you exactly where an

> application
> > > spends its time. Get one of these and use it.

> >
> > Thanks, I'll look into that!

>
> While in the end the output may be very nice, I always find profilers
> a little difficult to set up. I mostly use poor man's sampling: hit
> CTRL-break (Windows) / CTRL-Backslash (UNIX) repeatedly to get some
> thread dumps (with many threads, these will be long). Often it's easy
> to tell where the bottleneck is. If you still have no idea after a
> minute, then go get a profiler ...
>
> Matthias


bongo, please let us know what you find out. The Java app I use at
work on Windows runs unacceptably slow. Pretty sure it is Windows as
the CPU sits pegged (dual 2.8GHz Dell). Windows seems to have become
slower and slower over the last several years.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ridiculously slow about:blank in IE7 and IE8 don@nospam.4me Computer Support 13 11-11-2011 05:37 PM
Ridiculously Slow SqlServer2005 Sorting? Mark Olbert ASP .Net 2 12-24-2005 03:16 PM
Identifying section and pages on WAP portal developped in ASP BOB AISS ASP .Net Mobile 0 01-05-2005 10:33 AM
Re: Computer has become ridiculously slow! Stephanie Computer Support 22 10-11-2003 02:16 PM
Computer has become ridiculously slow! Stephanie Computer Support 8 10-08-2003 09:52 PM



Advertisments