Benchmark clear() behavior with OOP handle

Examine Matlab's "clear" behavior with different handle reference configurations.

You are now following this Submission

Create N handle objects, store 1-3 references to each.
Order of object creation, number of references, and configuration of references all have drastic impact on "clear" time as function of number of objects. Times range from flat, to linear, to quadratic.

Using a simple handle class:
% % classdef simpleHandle < handle
% % properties
% % ref1;
% % ref2;
% % end
% % methods
% % function self = simpleHandel
% % end
% % end
% % end

Cite As

Benjamin Heasly (2026). Benchmark clear() behavior with OOP handle (https://www.mathworks.com/matlabcentral/fileexchange/23132-benchmark-clear-behavior-with-oop-handle), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Administrator requested update in order to auto-add BSD license.

1.0.0.0