ArcMap running scripts slower if you import Arcpy

I have put this code into my script and it runs much quicker:

try:
    arcpy 
except NameError:
    import arcpy

This is saving considerable time in our scripts in ArcMap now.

This may all change in SP2, but none the less...


ArcGIS needs to spin up the runtime (that means loading a fairly sizable number of DLLs) when a process first loads the ArcObjects runtime. It's the same as the time going from the splash dialog in ArcMap to the ArcMap window or the time it takes to spin up an ArcGIS Engine process. In ArcMap the DLLs are already loaded for you so this process has already been done for you.