Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm working on a standalone script where I need to import arcpy. This usually takes close to 10 seconds, which is a little more than ideal. I'm only using a few Data Management tools and some base methods, so I was thinking it might be faster to only load the modules I'm using. I can see all the .py files in C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy, but I'm not sure which ones to load. These are the methods I'm using:

  • Exists
  • Delete_management
  • CreateTable_management
  • AddField_management
  • InsertCursor
  • CreateRelationshipClass_management

Any help will be much appreciated!

share|improve this question
    
With a decent SSD it takes about 2 seconds to import arcpy, or about 5 seconds to open ArcMap. Highly recommended if you can afford one! –  blah238 Feb 8 '13 at 4:08
    
I'm on a pretty powerful machine at work, not SSD but we do have 7200 RPM drives. But thanks for the suggestion, I'll look our for a deal :) –  Mapbert Feb 8 '13 at 4:44

1 Answer 1

up vote 3 down vote accepted

There's not a whole lot you can do here, very little of the overall load time is going to be because of any Python source. Loading Arcpy requires the system to bootstrap ArcObjects, which in turn checks out a license, loads a couple of dozen DLLs, etc. If you selectively import the .py files in arcpy, you've still got that overhead of loading all the support files in the ArcGIS runtime.

share|improve this answer
    
Thanks for explaining this Jason, I had no idea there was so much going on. What's a little more Esri cruft to deal with anyway? :) –  Mapbert Feb 8 '13 at 4:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.