9

I am finding ArcMap runs slower, if you have written a script, which imports arcpy.

You may wish to write a script that can be operated in ArcMap, through the python window, or as a standalone python script. If so, you'll have to import arcpy. However, if you do this and run it in the python window, it will run slower.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jul 19, 2011 at 9:14
0

2 Answers 2

11

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...

mindless.panda
1,3272 gold badges16 silver badges26 bronze badges
answered Jul 19, 2011 at 14:11
0
8

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.

scw
16.4k6 gold badges66 silver badges101 bronze badges
answered Jul 21, 2011 at 3:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.