Performing early testing for enabled status

Early testing for the enabled status of the potential trace record is recommended, to avoid negative impact on performance. For example, if instead of using the above procedure to check for enabled status, you used the procedure shown below, the message and terminal identifier objects would be created every time, even if the trace record itself is not created.
aMessage = ...;
aTID = ...;
Trace.trace(true,MyClass.COMPID,Trace.Medium,Trace.Debug,aTID,aMessage); 

aMessage and aTID are always created even when the component is not registered for the level "Medium" and the type "Debug". This results in a useless object creation.