I was trying to write a wrapper for a third party C tool using Java processbuilder. I need to run this process builder millions of times. But, I found something weird about the speed.
I already have a wrapper for this third party tool C tool for python. In python, the wrapper uses the python subprocess.check_output.
So, I ran the java wrapper 10000 times with same command. Also, ran the python wrapper 10000 time with same command.
With python, my 10000 tests ran in about 0.01 second.
With java processbuilder, it ran in 40 seconds. 
Can someone explain why I am getting large difference in speed between two languages?
You try this experiment with a simple command like "time".
It seems like python doesn't spawn subprocess. Which is why it was faster.
I am sorry with confusion. 
thank you
why is Java Processbuilder 4000 times slower at running commands then Python Subprocess.check_output