How to pre-initialize MCR for .NET assemblies generated from Compiler SDK

4 views (last 30 days)
I am integrating .NET assembly generated from Compiler SDK into my C# app. And I would like to to speed up the first initialization of MCR. Is there any way that I could do a pre-initialization?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Nov 2021
Unfortunately, currently there is no way to pre-initialize MATLAB Runtime. But here are some approaches that could potentially improve the first MATLAB Runtime startup time: 
  1. Install the runtime on a fast local disk rather than a network shared drive. Since there are a lot of file accessing during the startup, a fast local disk will make the process faster. 
  2. If your application does not require Java JVM, you could use the “nojvm” option by applying the following assembly attributes: 
[assembly: NOJVM(true)] 
For an example on that, please refer to documentation in the link below: 

More Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!