Python package created using Matlab Compiler taking long time to start execution

2 ビュー (過去 30 日間)
Sree hari
Sree hari 2016 年 9 月 13 日
回答済み: Chetan Rawal 2016 年 9 月 14 日
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.

回答 (1 件)

Chetan Rawal
Chetan Rawal 2016 年 9 月 14 日
The delay is due to MATLAB Runtime startup time. If you can keep the MATLAB Runtime running on the server between calls, you won't see the delay. Tips: http://undocumentedmatlab.com/blog/speeding-up-compiled-apps-startup

カテゴリ

Help Center および File ExchangeMATLAB Compiler SDK についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by