Question

I have attached a screenshot of the cProfile results of a Python script. I know the second line refers to a geoprocessing function in the arcpy site-package. However, I am unclear what the first line refers to:

C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing_base.py:498()

I see line 1 was called 3 times at 72s per call and line two was called once for 216s per call. However, these do not appear to add up to 219s. How should I interpret these results?

enter image description here

Was it helpful?

Solution

You need to differentiate cumulative time from function time. The numbers on the left correspond to time actually consumed in this function. Cumulative includes both time consumed in this function, plus time consumed in all subfunctions.

So, in this case, FeatureClassToFeatureClass called a lambda function 3 times, but otherwise did very little. The lambda itself took ~72s per call, for 3 calls, for a total of ~216s. It didn't call anybody else, so its cumulative time is roughly equal to its cum time. The FeatureClassToFeatureClass function did not do much itself, so its total time is nearly zero. However, since it called the lambda function 3 times, and that function was long-running, its cumulative time is high.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top