A number of methods are called here, but without a doubt the most expensive (in terms of having a negative impact on performance) is the call to Notification. Notification looks like this:
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TComponent.Notification(AComponent: TComponent; Operation: TOperation) ;
var
j: Integer;
begin
if (FFreeNotifies <> nil) and (Operation = opRemove) then
begin
FFreeNotifies.Remove(AComponent) ;
if FFreeNotifies.Count = 0 then
begin
FFreeNotifies.Free;
FFreeNotifies := nil;
end;
end;
if FComponents <> nil then
for j := 0 to FComponents.Count - 1 do
TComponent(FComponents[j]).Notification(AComponent, Operation) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
This time-intensive code here is the last for-loop, which iterates through every single owned component, calling Notification again (it's a iterative call, so every component either owned or indirectly owned by the form (or whatever component was initially passed as the AOwner parameter), will have this method called. Additionally, the Notification method is virtual, so it can be overridden in descendant classes (and often is).


