[Paraview] Optimize Programmable Filter execution

Moreland, Kenneth kmorel at sandia.gov
Thu Feb 25 15:07:47 EST 2016


The Programmable Filter uses a plain ol' Python interpreter. Some simple Google searches will give advice on writing more efficient Python code.

Generally speaking, Python, as with any interpreted language, does not execute all that fast. Thus, long loops in Python code are probably not going to execute very fast. Operations on numpy arrays are comparatively much faster. If you could reconstruct your loops to instead do operations on numpy arrays (which internally will loop through the elements much faster), then your code should go remarkably faster. There are lots of tricks you can do with indexing to implement features like conditional execution on a per-element basis.

-Ken


From: ParaView <paraview-bounces at paraview.org<mailto:paraview-bounces at paraview.org>> on behalf of Jean-Michel Lucas <jm.lucas at gantha.com<mailto:jm.lucas at gantha.com>>
Date: Thursday, February 25, 2016 at 10:19 AM
To: 'ParaView' <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] [Paraview] Optimize Programmable Filter execution

Dear all,

I currently have a Programmable Filter that takes a long time to execute and I am looking for a way to optimize it.
The code loops over a large number of points and I have a lot of operations involving numpy arrays.
What are the possible steps that I could follow to make the execution faster ? The question is not very specific, I am looking for general guidelines.

Thanks in advance,
Jean-Michel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160225/d55d9b54/attachment.html>


More information about the ParaView mailing list