?
Solved

Java GUI is extremely slow if accessed by X-Windows

Posted on 2005-03-16
14
Medium Priority
?
1,117 Views
Last Modified: 2012-05-05
Hello

I'm running applications on Solaris 8 machine accessed using XWindows.
There is slow network connection to the machine.
Native applications are running slowly, but the performance is aceptable.
Java GUI applications are extremely slow.

How can I make it appear faster ?

I cannot change the connection speed, but I'm developer of the java applications, so I can modify the source code, if necessary ...

Best regards
Mirec
0
Comment
Question by:MirecXP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
14 Comments
 
LVL 92

Accepted Solution

by:
objects earned 128 total points
ID: 13553227
switching from swing to swt should improve performance (if thats an option)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13553418
java 5 should speed it up too...
0
 
LVL 6

Assisted Solution

by:durgaprasad_j
durgaprasad_j earned 124 total points
ID: 13553931
hi,
 why are you considering the network connection here ?? //Are you accesing any outside information throught network

 IMO, you are first getting some outside information through network and then you are showing the GUI. //Thats why your gui is slow.

 Try the same in other way

 First make the gui and show the gui, then take all the outside information and add that into gui. In this way, you can show the gui faster. And as suggested by TimYates, try to use J2SE 5.0, in which performance is better than the previous versions.

Hope this helps
Durga Prasad
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:MirecXP
ID: 13554340
Thanks for comments.

To durgaprasad_j :
No. The application is running very fast when is accessed locally. But the GUI renders itself very slowly when it's accessed remotelly using XWindows (something like remote desktop on Unix systems).
It seems java renders the gui for XWindows into bitmap or something similar, sends it accross network and XWindows on my client machine displays it.
When accessing native application by XWindows, GUI is transmitted more faster. I'm not familiar with technical background of XWindows, maybe native application GUI is transmitted more optimized...

To objects:
Thanks for the tip.
SWT looks good, i'll try it, but I'm afraid, I can't afford to make such a big changes when doing Swing -> SWT migration, while it could spend much effort.

To TimYates:
Has Java5 an improvement in this issue ? I can't install new Java on the machine, now, so I'll try it next week.

I use JDK1.3.1, by the way.

Kind regards
Mirec
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 124 total points
ID: 13554393
>> Has Java5 an improvement in this issue?

Yeah, java 1.4 had an improvement, then 1.5 built on that improvement...

It's moving towards using OpenGL for rendering controls (where possible)

You should notice quite a good increase...

And I believe 1.4 should be much faster for any collections/math you do

1.3 is quite an old version of java :-(
0
 
LVL 6

Expert Comment

by:durgaprasad_j
ID: 13554566
hi,
   when i tried "export DISPLAY " in my lab [ network speed 100MBPs] . Its working fine like other native programs. I think its the problem with version.

DP
0
 
LVL 1

Author Comment

by:MirecXP
ID: 13554615
Yes, on local network or with good connection, it's working fine, but when the connection is poor, it's worse. Even though native apps are running quite good with slow network.
0
 
LVL 6

Expert Comment

by:mightyone
ID: 13554655
What is your application doing? Is there any Socket traffic? On some older X systems or if there is plenty of networktraffic it may speed up immensely by just setting TCPDelay to false.
0
 
LVL 1

Author Comment

by:MirecXP
ID: 13556118
I think no. But i'm testing it on simple demo app now, which does nearly nothing... Just to have a gui.
0
 
LVL 6

Expert Comment

by:mightyone
ID: 13556402
check your solaris TCPDelay settings also!
0
 
LVL 1

Author Comment

by:MirecXP
ID: 13556615
What is TCPDelay ? How can I change it ? Is it possible to change it without admin rights ?

thanks
0
 
LVL 6

Assisted Solution

by:mightyone
mightyone earned 124 total points
ID: 13578004
Google for nagle algorithm and sun....

try this
http://www.koders.com/java/fidF3ADF03E176011AC2FACEC7399AE37CCB9CB4819.aspx

it is an apache prog about an ssl java connection using TCPNODELAY. (Pretty good code about sockettransfer btw.)

or configure your sockets like e.g.
public class ConfigureSocket {
    private final int receiveBufferSize;
    private final int sendBufferSize;
    private final boolean tcpNoDelay;
 
    public ConfigureSocket(int receiveBufferSize, int sendBufferSize, boolean tcpNoDelay) {
        this.receiveBufferSize = receiveBufferSize;
        this.sendBufferSize = sendBufferSize;
        this.tcpNoDelay = tcpNoDelay;
    }
   
    public void configure(Socket socket) throws SocketException {
        socket.setTcpNoDelay(tcpNoDelay);
        if (receiveBufferSize > 0)
            socket.setReceiveBufferSize(receiveBufferSize);
        if (sendBufferSize > 0)
            socket.setSendBufferSize(sendBufferSize);
    }
}

and
public static String asString(Socket socket) throws SocketException {
        return socket +
                ", tcpNoDelay=" + socket.getTcpNoDelay() +
                ", receiveBufferSize=" + socket.getReceiveBufferSize() +
                ", sendBufferSize=" + socket.getSendBufferSize();
    }

an article witch helped me on linux is found under
http://www.icase.edu/coral/LinuxTCP.html

but i think you have to google for solaris... sorry


MightyOne
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question