<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>The Programmable Filter uses a plain ol' Python interpreter. Some simple Google searches will give advice on writing more efficient Python code.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>-Ken</div>
<div><br>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>ParaView <<a href="mailto:paraview-bounces@paraview.org">paraview-bounces@paraview.org</a>> on behalf of Jean-Michel Lucas <<a href="mailto:jm.lucas@gantha.com">jm.lucas@gantha.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, February 25, 2016 at 10:19 AM<br>
<span style="font-weight:bold">To: </span>'ParaView' <<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] [Paraview] Optimize Programmable Filter execution<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div lang="FR" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><span lang="EN-US">Dear all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I currently have a Programmable Filter that takes a long time to execute and I am looking for a way to optimize it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The code loops over a large number of points and I have a lot of operations involving numpy arrays.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Thanks in advance,<o:p></o:p></p>
<p class="MsoNormal">Jean-Michel<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>