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 
<[email protected]<mailto:[email protected]>> on behalf 
of Jean-Michel Lucas <[email protected]<mailto:[email protected]>>
Date: Thursday, February 25, 2016 at 10:19 AM
To: 'ParaView' <[email protected]<mailto:[email protected]>>
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to