Matlab Coding in C++ with forest is very long and consumes it in RAM

13 views (last 30 days)
We try to generate c++ library from Matlab functions with random forest inside.
We run code generation on 2,4ghz cpu and 60 Go RAM.
Our 3 forests size (50-120Mo).
The library generation duration is 3 hours and it use 60go RAM.
The other library code generation duration are a few minutes (without random forest of course).
My questions :
Do you have similar codegen duration with random forest? Same question with RAM usage?
Do you have tricks to speed up code generation and decrease RAM usage?

Answers (1)

Manish
Manish on 12 May 2025
Hi,
Regarding the query, "Do you have tricks to speed up code generation and decrease RAM usage?":
You can use the 'compact' function to reduce the size of the model.
Refer to the documentation below for more information:
Additionally, please refer to the following documentation for steps to increase code generation speed:
Hope this helps!

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!