Forum
Important Notice for New User Registrations
To combat an increasing number of spam and bot registrations, we now manually approve all new user registrations. While this may cause a delay until your account is approved, this step is essential to ensure the quality and security of this forum.
To help us verify your registration as legitimate, please use a clear name as user name or an official email address (such as a work, university, or similar address). If you’re concerned that we may not recognize your registration as non-spam, feel free to email us at with a request to approve your username.
Some doubt on the execution time of QBLIB.unload() function
Quote from Chen on 18. February 2025, 04:33Hello David,
Recently my colleague told me that QBLIB.unload() function had long execution time, second only to QBLIB.advanceTurbineSimulation() function. He showed me related video and the inspection results by Matlab inspector. However, I can load/unload the QBlade library very fast and the execution time can be neglected, tic/toc command and inspection results also supported it. Our compute devices, simulation tests tasks, MATLAB and QBlade versions are the same, I wonder what reason can cause such difference.
Yours sincerely,
Chen
18/02/2025
Hello David,
Recently my colleague told me that QBLIB.unload() function had long execution time, second only to QBLIB.advanceTurbineSimulation() function. He showed me related video and the inspection results by Matlab inspector. However, I can load/unload the QBlade library very fast and the execution time can be neglected, tic/toc command and inspection results also supported it. Our compute devices, simulation tests tasks, MATLAB and QBlade versions are the same, I wonder what reason can cause such difference.
Yours sincerely,
Chen
18/02/2025

Quote from David on 18. February 2025, 12:21Hi Chen,
The
unload()
function serves as a simple destructor for the QBlade Library object, in this case its calling some Matlab specific functions on the library object. If you encounter any issues, you can find the source code in QBladeLibrary.m and modify it accordingly:% Destructor
function unload(obj)
% Unload Library
if libisloaded(‘QBLIB’) % Check if the library is loaded
try
% Unload the library
unloadlibrary(‘QBLIB’);
disp(‘Library unloaded successfully.’);
catch ME
warning(‘Error during library unloading: %s’, ME.message);
end
else
disp(‘Library is not loaded. No action taken.’);
end
endI cant tell you why you are experiencing the differences that you describe. Maybe you could try implementing your own very simple destructor and test how its performing?
BR,
David
Hi Chen,
The unload()
function serves as a simple destructor for the QBlade Library object, in this case its calling some Matlab specific functions on the library object. If you encounter any issues, you can find the source code in QBladeLibrary.m and modify it accordingly:
% Destructor
function unload(obj)
% Unload Library
if libisloaded(‘QBLIB’) % Check if the library is loaded
try
% Unload the library
unloadlibrary(‘QBLIB’);
disp(‘Library unloaded successfully.’);
catch ME
warning(‘Error during library unloading: %s’, ME.message);
end
else
disp(‘Library is not loaded. No action taken.’);
end
end
I cant tell you why you are experiencing the differences that you describe. Maybe you could try implementing your own very simple destructor and test how its performing?
BR,
David
