File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Executing a Shell-Skript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Executing a Shell-Skript" Watch "Executing a Shell-Skript" New topic
Author

Executing a Shell-Skript

hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
Hi,

I am trying to execute a shell-script using Runtime.getRuntime.exec(), but it seems to be very slow.

Executing the Skript from console it takes nearly 100 milliseconds, using Runtime.getRuntime.exec() it takes 700 milliseconds.

What do I have to do to increase the speed or is there a faster way to execute a shell script?

Thanks for any help,
Hal
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

There's no reason why executing a script from Runtime.exec() should be slow. How are you measuring the times? Do the commands within the script run slower, or is it slower to start up? What does the script do?


[Jess in Action][AskingGoodQuestions]
hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
To measur the time in the console I am using the command time, which prints the used time in milliseconds.
In Java I subtract two Dates:


The script is a driver for a webservice, it sends requests to a service an prints the response.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing a Shell-Skript
 
Similar Threads
How to provide password to the prompt through Java
More Runtime questions
Executing Exe. files from HTML File Using Scripting
Executing .exe file using Script.
Problem in Executing .exe file using Script