• Post Reply Bookmark Topic Watch Topic
  • New Topic

how good is to call exec() method ??

 
Oni Anand
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
My question is how good is it from performance point of view ot call exec() method from within java program ??
i want to open an xml editor from with in my java program for creating an xsd file ?? my doubt is whether it is a good idea or i should never call exec() for these purposes ??

thanks for help
Oni
 
Jack Shirazi
Author
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exec() executes another program. Obviously this has all the overheads of the other program and OS process startup overheads.
If speed is important, you will get better performance if you can execute the functionality within your own Java program. Normally exec() is called when the functionality is unavailable, too difficult to implement, or too expensive to include in your Java program. Or when you want the functionality and can happily cope with the secondary process overhead.
--Jack Shirazi http://www.JavaPerformanceTuning.com/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!