How To Speedup Java Over 100% Come speedup Java oltre il 100%
Java is used either for long running server side applications / application servers or for running short scripts. Java è utilizzato per le lunghe le tue applicazioni lato server / application server o per l'esecuzione di script breve. Let’s look at how you can speed-up both these type of applications. Vediamo come si può accelerare il ritmo di entrambi questi tipo di applicazioni.
How to speed-up server-side Java applications Come accelerare il ritmo di lato server applicazioni Java
It is very simple really. E 'davvero molto semplice. Just add -server after the java command like this: Basta aggiungere-server dopo il comando java in questo modo:
java -server HelloWorld Java-server HelloWorld
Replace HelloWorld with your application name. Ciao a sostituire con il tuo nome. That wasn’t so hard was it? Che non è stato così difficile è stato?
How to speed-up client-side Java applications Come accelerare il ritmo di lato client applicazioni Java
Download Scaricare and install nailgun. nailgun e installare. You may want to read the Ti suggeriamo di leggere il quickstart guide Guida rapida for details. per i dettagli.
Nailgun is a simple application server which allows you to run Java programs rapidly through the server instance. Nailgun è un semplice server applicativo che permette di eseguire programmi Java rapidamente attraverso il server di esempio. The nailgun client (ng for linux and ng.exe for windows) is a small c program which works on both windows and linux platforms. Il nailgun client (ng per Linux e ng.exe per windows) è un piccolo programma in C che funziona su entrambe le finestre e le piattaforme Linux. To run Java applications you just have to substitute ng (assuming it is in path) for java. Per eseguire le applicazioni Java è sufficiente sostituire il GN (ammesso che è in cammino) per Java. ng reduces startup time by running programs from the same instance. ng riduce il tempo di avvio di programmi in esecuzione dello stesso grado. However it uses socket connection for communication which can be further optimized. Tuttavia si utilizza la connessione socket per la comunicazione che può essere ulteriormente ottimizzato.
Let’s see how much ng improves the performance for simple client side applications. Vediamo come migliora di molto le prestazioni per semplici applicazioni lato client.
Here is a simple HelloWorld program I ran using java: Qui è un semplice programma Ciao ho eseguito tramite java:
[angsuman@jaguar project]$ time java HelloWorld Hello World! [angsuman @ jaguar progetto] $ time java HelloWorld Ciao a tutti! real 0m0.107s user 0m0.049s sys 0m0.012s reale 0m0.107s sys 0m0.049s user 0m0.012s
Here is the same program run using nailgun: Qui è lo stesso programma utilizzando nailgun:
[angsuman@jaguar project]$ time ../software/nailgun-0.7.1/ng HelloWorld Hello World! [angsuman @ jaguar progetto] $ tempo ../software/nailgun-0.7.1/ng Ciao Ciao a tutti! real 0m0.002s user 0m0.000s sys 0m0.001s reale 0m0.002s sys 0m0.000s user 0m0.001s
Can you see the difference? Potete vedere la differenza?
Here is the result of running helloworld in C (compiled with gcc): Qui è il risultato di esecuzione HelloWorld in C (compilato con gcc):
[angsuman@jaguar project]$ time ./hello Hello World! [angsuman @ jaguar progetto] $. / ciao Ciao a tutti! real 0m0.001s user 0m0.001s sys 0m0.001s reale 0m0.001s sys 0m0.001s user 0m0.001s
I am using: Sto usando:
[angsuman@jaguar project]$ java -version java version “1.6.0_01″ Java(TM) SE Runtime Environment (build 1.6.0_01-b06) Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode) [angsuman @ jaguar progetto] $ java-version java version "1.6.0_01" Java (tm) SE Runtime Environment (build 1.6.0_01-b06) Java HotSpot (TM) Server VM (build 1.6.0_01-b06, modalità mista) The Java code is: Il codice Java è:
public class HelloWorld { public static void main(String args[]) { System.out.println("Hello World!"); } } public class HelloWorld (public static void main (String args []) (System.out.println ( "Ciao Mondo!");)) The c code is: Il codice C è:
#include # includeint main(void) { printf(”Hello World!\n”); } int main (void) (printf ( "Ciao a tutti! \ n");)
Let’s finally put to rest the myth that “ Let's finalmente messo a riposo il mito che " Java is slow Java è lento “. ".
Filed under Elencato sotto Enterprise Software Enterprise Software , Headline News Headline News , How To Come , Java Software Software Java , Linux , Open Source Software Software open source , Programming Programmazione , Tech Note Nota tech | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |




August 29th, 2007 at 3:14 pm 29 agosto 2007 alle 3:14 pm
I downloaded Nailgun and tried out a little test and was impressed by the speed. Nailgun ho scaricato e provato un po 'di test ed è stato impressionato dalla velocità. I did have issues when I tried to run multiple clients through it at the same time. L'ho fatto avere problemi quando ho cercato di eseguire più clienti attraverso di essa allo stesso tempo. When the first exited, they all did. Quando la prima uscita, tutti ha fatto. It looks like it is not supported anymore… Last build was Feb, 2005. Sembra che non è più supportate… Ultima costruire è stata febbraio, 2005. Is there any similar alternatives out there? Vi è alcuna simile alternative là fuori?
September 25th, 2007 at 7:11 am 25 settembre 2007 a 7:11 am
I can build one if there is sufficient demand. Sono in grado di costruire uno se vi è una domanda sufficiente.
March 13th, 2008 at 10:10 am 13 marzo 2008, 10:10 am
It looks like it just speedups the startup time, but most of proffesional apps are started only once a month, so there is no speedup in that case. Sembra che solo speedups il tempo di avvio, ma la maggior parte delle applicazioni professionale sono iniziati solo una volta al mese, per cui non vi è alcuna speedup in questo caso.
The same trick like for example in winamp agent. Lo stesso trucco come ad esempio in Winamp Agent.
But of course very nice idea for some small applications run by user to do small tasks. Ma naturalmente molto buona idea per alcune piccole applicazioni gestite da utente a fare piccoli compiti.