Performance tuning of a Python toolbox gp service

675
0
04-09-2013 07:13 AM
Laurensvan_der_Burgt
New Contributor III
The performance of geoprocessing (services) has improved over the past years and releases. Also, the concept of Python Toolboxes made it easier for me to develop gp services 🙂

Some best practices which I am aware of are the use of gp environment settings and the use of feature layers instead of feature classes as input for gp tools.

I wonder if I can use certain "best practices" to speed up gp operations which are based on SDE feature classes. Obviously, the use of file geodatabases can yield major improvements, but this is not desirable in my case.

In addition to that, I am curious if it would be possible to use the Python toolbox constructor methods to execute gp logic only once (at start time of the service).
Unfortunately, testing proved that it is not allowed to add arcpy gp calls in the __init__ of the gp toolbox. Code in the __init__ of the Tool is executed (several times!?) at the start of each job, which makes it useless for performance optimization purposes.
(see attached log file; I added a log entry for each pass of the tool constructor and for the execute method)

Apart from the pyt constructors I would be very interested in practices which enable some sort of caching for datasets, so data becomes more readily available (contrary to fetching data from SDE each time).

Cheers!
Laurens
0 Kudos
0 Replies