Saturday 19 January 2019

arcpy - Maximizing the use of CPU


My script is intersecting lines with polygons. It's a long process since there are more than 3000 lines and more than 500000 polygons. I executed from PyScripter:



# Import
import arcpy
import time

# Set envvironment
arcpy.env.workspace = r"E:\DensityMaps\DensityMapsTest1.gdb"
arcpy.env.overwriteOutput = True

# Set timer
from datetime import datetime

startTime = datetime.now()

# Set local variables
inFeatures = [r"E:\DensityMaps\DensityMapsTest.gdb\Grid1km_Clip", "JanuaryLines2"]
outFeatures = "JanuaryLinesIntersect"
outType = "LINE"

# Make lines
arcpy.Intersect_analysis(inFeatures, outFeatures, "", "", outType)


#Print end time
print "Finished "+str(datetime.now() - startTime)


My question is: is there a way to make the CPU work at 100%? It's running at 25% all the time. I guess that the script would run faster if the processor was at 100%. Wrong guess?
My machine is:




  • Windows Server 2012 R2 Standard

  • Processor: Intel Xeon CPU E5-2630 0 @2.30 GHz 2.29 GHz


  • Installed memory: 31,6 GB

  • System type: 64-bit Operating System, x64-based processor




enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...