# Multiple Ring Buffer too slow?

I have to make multibuffer to a several shp's (30 or +) and with this code the it takes 30 minutes or more.

``````    import arcpy,time,glob,os
def multibuffer (probe,Zona_trab,nombarch3,recortes2):
x=0
bufdef = (Zona_trab,"\\bufferRing",time.strftime("%H%M%S"),".shp")
bufferRings = ''.join(bufdef)
if probe == 1:
with open (nombarch3) as p:
for x in recortes2:
arquet, valbuf2, datperm= dtaring.split(",")
valbuf2=float(valbuf2)
a= valbuf2*0.3
b= valbuf2*0.5
c= valbuf2
distances = [a,b,c]
puntselec1a2 = (Zona_trab,"\\puntsele",x,".shp")
puntsele2 = ''.join(puntselec1a2)
print puntsele2
print distances
arcpy.MultipleRingBuffer_analysis(puntsele2,"capadeRingbuff"+str(x)+".shp", distances, "meters", "", "ALL")
p.close
wcard="puntsele*"
try:
dir=Zona_trab+os.sep+wcard+'.shp'
flist=glob.glob(dir)
arcpy.Merge_management(flist, bufferRings)
except:
print "error"
``````

The code works, it have no errors, so it will work slow, but safe. My question is:

what would you do for speed up the process?

The first part of the program is done instantly, but this call:

``````arcpy.MultipleRingBuffer_analysis(puntsele2,"capadeRingbuff"+str(x)+".shp", distances, "meters", "", "ALL")
``````

Make the stop of several minutes in the script.

With this new info, someone know how to speed up this part? Doing several MultipleRingBuffer at once or something like that? (I think is not posible to make that)

• Have you done some performance timing? I suspect that you will find the Multiple Ring Buffer tool to be consuming far more time than your ArcPy code. – PolyGeo Feb 17 '15 at 11:12
• Making the first part its quick, but the arcpy.MultipleRingBuffer_analysis(puntsele2,"capadeRingbuff"+str(x)+".shp", distances, "meters", "", "ALL")its too slow. There are some ways to make this faster or that is the limit? – Gsanez Feb 17 '15 at 12:29
• As you are calling an existing tool you don't have any control of what is going on inside it. The only thing I can think of that could improve performance is to write the output Feature Class to an in_memory workspace then merge those. – Hornbydd Feb 17 '15 at 15:21
• Please use the edit button to provide clarifications to your question. – PolyGeo Feb 17 '15 at 20:13