2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

EXE(スタンドアロン化)したときの起動時間を改善

2
Posted at

mlappをEXE化したときの初回起動が遅くなる要因:

1.MATLAB Runtime(MCR)の初期化
 ・ライブラリの読み込み
 ・Java VMの起動
 ・各種DLLのロード
2.CTFファイルの展開
 ・EXEに含まれるファイルを一時フォルダへ展開
 ・ctfroot 配下にコピーされる
3.JITコンパイルやクラスのロード
 初めて使用するクラスや関数の初期化

これはどうしようもないらしいが、次回以降については改善の余地あり
環境変数(MCR_CACHE_ROOT)を設定することで改善は可能
自動的にキャッシュフォルダの生成と環境変数を行うBATファイル

@echo off

set APPDIR=%~dp0
set MCR_CACHE_ROOT=%APPDIR%MCRCache

if not exist "%MCR_CACHE_ROOT%" mkdir "%MCR_CACHE_ROOT%"


setx MCR_CACHE_ROOT "%MCR_CACHE_ROOT%"
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?