38 * 16 = 608
80 / 608 = 0.1316 seconds per plot

At this point, I doubt you are going to get much more speed-ups.  Glad to be of help!

Fabrice -- Good suggestion!  I should have thought of that given how much I use that technique in doing animation.

Ben Root


I am including profiled runs for the records --only first 10 lines to keep e-mail shorter. Total times are longer comparing to the raw run -p executions. I believe profiled run has its own call overhead.

I1 run -p test_speed.py
 171889738 function calls (169109959 primitive calls) in 374.311 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  4548012   34.583    0.000   34.583    0.000 {numpy.core.multiarray.array}
  1778401   21.012    0.000   46.227    0.000 path.py:86(__init__)
   521816   17.844    0.000   17.844    0.000 artist.py:74(__init__)
  2947090   15.432    0.000   15.432    0.000 weakref.py:243(__init__)
  1778401    9.515    0.000    9.515    0.000 {method 'all' of 'numpy.ndarray' objects}
 13691669    8.654    0.000    8.654    0.000 {getattr}
  1085280    8.550    0.000   17.629    0.000 core.py:2749(_update_from)
  1299904    7.809    0.000   76.060    0.000 markers.py:115(_recache)
       38    7.378    0.194    7.378    0.194 {gc.collect}
 13564851    6.768    0.000    6.768    0.000 {isinstance}




I1 run -p test_speed3.py
 61658708 function calls (60685172 primitive calls) in 100.934 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   937414    6.638    0.000    6.638    0.000 {numpy.core.multiarray.array}
   374227    4.377    0.000    7.500    0.000 path.py:198(iter_segments)
  6974613    3.866    0.000    3.866    0.000 {getattr}
   542640    3.809    0.000    7.900    0.000 core.py:2749(_update_from)
   141361    3.665    0.000    7.136    0.000 transforms.py:99(invalidate)
324688/161136    2.780    0.000   27.747    0.000 transforms.py:1729(transform)
    64448    2.753    0.000   64.921    0.001 lines.py:463(draw)
   231195    2.748    0.000    7.072    0.000 path.py:86(__init__)
684970/679449    2.679    0.000    3.888    0.000 backend_pdf.py:128(pdfRepr)
    67526    2.651    0.000    7.522    0.000 backend_pdf.py:1226(pathOperations)



--
Gökhan