addin in visual studio 2005 and solidworks 2007

Hi,
we have written an add in to this customer. the addin works great,but... when opening a large assembly they get very slowperformence.
we have debug the add in and found out that if the following codeis removed there is no problem.
the code was automatically added by solidworks template downloadedfor visual studio 2005 from the web site.
the code is:
Function SldWorks_DocumentLoadNotify(ByVal docTitle As String,ByVal docPath As String) As Integer
Dim modDoc As ModelDoc2
Dim mdoctype As Integer
modDoc = iSwApp.GetFirstDocument()
'While Not modDoc Is Nothing
' If modDoc.GetTitle = docTitle Then
' mdoctype = modDoc.GetType
' If Not openDocs.Contains(modDoc) Then
' AttachModelDocEventHandler(modDoc)
' End If
' End If
' modDoc = modDoc.GetNext()
'End While
End Function

if i take off the remarks solidworks returns to work slowly whileopening the assembly. what is the need for this code? what else doI need to remove if this code is removed? what are the issues thatI am supposed to be facing if I removed this code?

EyalSolidworksApi macros