I'm working on a huge application and we got some serious troubles regarding the performance of the software. I don't want to bother you with too many details, so in short:
- in one JVM runs the GUI (JavaFX)
- in another JVM runs the logic
- the two JVMs communicate with eachother over socket (for fast transmissions) and http
The logic-jvm is doing periodically (1/10s) some data analysis and creates a structure containing some numbers and images (rgb,640*480). The gui needs to visualize this data in the same speed and displaying the images. Currently the gui requests 10 times a second this data from the logic jvm over http, whereas the data itself is sent over a socket connection. This circumstance came from the idea to be able to attach multiple gui to one logic. But as the time showed, we will not be doing this. Furthermore, the performance is really bad, as soon as the data (mainly due to more images) gets bigger (250MB). It seems that the bottleneck is, where we put the image data into the bytebuffer and sending it. As stated before, we probably won't ever have multiple gui - so why not using only one jvm.
What speaks for the current solution:
- We can set the priority of the applications in windows. the logic really needs to run smoothly and is given a high priority. The gui application should also run smoothly but nobody cares if it would skip a frame or two.
Further the gui has some views, in which properties (for simplicity SimpleObjectProperty) in the logic should be altered. I.e. a JavaFx TextField should be bound bidirectional to a SimpleString property in the logic part. So updating the string inside the logic will alter the textfield and vice-versa.
TextField tf = new TextField(); tf.textProperty().bindBidirectional(observableOfLogic);
I hope you get some feeling for the situation.
Now I finally like to state my question:
What is the best design for such a problem?
Thank you very much in advance.