Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Java GUI is extremely slow if accessed by X-Windows

Posted on 2005-03-16
14
Medium Priority
?
1,118 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
  • 4
  • 3
  • 2
  • +2
12 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

581 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