Module Performance

I have built a couple scripting modules for Ignition, I am still new to Java and the module dev side so forgive me if this question is obvious or just dumb.

I was toying around with the idea of building an API to replace the module, and out of curiosity what would the performance difference be executing my module functions(performing database operations, calculations, etc.) vs using an API built in Go to use those same functions?
The only reason I am really curious about this is, I am more familar with Go and have already built an API similar to the Ignition module I made.

That being said, I don't really know how or where to start as far as measuring performance, and so I was hoping someone with more understanding of software would be able to answer my question.

The answer is really "it's impossible to say", but as a general rule, the boundary layer of your API is going to be significantly slower than anything in-process. Exactly how much slower depends on whether you're talking over the network vs on the local machine, for instance, but it's always going to be slower to talk to another process than to run something within your own memory. In addition, any kind of remote procedure call implies serialization/deserialization or otherwise manipulating the data you are sending into an appropriate format to receive on the other end (and the inverse operation to send a result back, if any).

3 Likes