0

I got a complex multithread program that calls to exit when it's done. I want to optimize its configurations and need to run it multiple times.

How can I do it in a JIT friendly way?

Note that this question is different from Java: How to test methods that call System.exit()?

I don't want to build a unitest for it but test the performance of the entire execution.

andrewJames
  • 19,570
  • 8
  • 19
  • 51
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • The alternative (easy) way is to modify the code so that it doesn't call `System.exit` when it is done. It shouldn't be hard to do. – Stephen C Aug 22 '20 at 05:33
  • Also explain what you mean by "JIT friendly". If JIT compilation is believed to be an issue that affects your application's *real world* performance, then you should be aiming to reproduce the way it is used in the real world. That means NOT running it multiple times in the same JVM. – Stephen C Aug 22 '20 at 05:36
  • Finally, don't dismiss the unit test Q&A. The linked question explains techniques that *can be used* in unit tests. They can also be used in other contexts, like yours. And furthermore, you could even implement your performance testing *as a unit test* ... that also just happens to take time measurements, etc. – Stephen C Aug 22 '20 at 05:48
  • @StephenC unitests are designed to test functionality, and they been optimized in that direction. Performance testing is done with other tools. Replacing the exit call with an exception, or catching it in other ways, will impact performances. I am looking for some multi-process solution – Ilya Gazman Aug 22 '20 at 13:13
  • Erm ... a multi-process solution is basically running the application in the normal way lots of times using a shell script or something. – Stephen C Aug 22 '20 at 13:49

0 Answers0