We have created a python package out of matlab code using Matlab Compiler, which exposes one function which is called from within a web app written in python. We found on close inspection that there is a significant time (~4 seconds) delay between the webapp making the call the to the python function in the python package created by the compiler and the first statement in the matlab code getting executed. The main matlab function itself executes fairly fast once it starts execution, but the initial delay is presenting a bottleneck. Is it some sort of runtime initialization ? But if at all that is the case , shouldn't it be just one once during the first call ? The delay happens for us on each call.
Why would this happen ? Could we be missing anything in terms of configuration or something ?
Environment : The python package is created using Matlab Compiler installed on a Linux box, and is also deployed on a Linux box. We dont use parallel pools yet.