<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CGA Profiling / Performance tuning: how to? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427442#M5867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tx!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a const might help indeed, however will it be constant per shape or for the entire rule evaluation? I guess I should be able to test this myself know that I know that I can put a print statement in a function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will test and let you know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2020 19:00:45 GMT</pubDate>
    <dc:creator>DaveLajoie</dc:creator>
    <dc:date>2020-07-20T19:00:45Z</dc:date>
    <item>
      <title>CGA Profiling / Performance tuning: how to?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427440#M5865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there is a way to profile our CGA code, is there a way to determine the number of calls for specific function, time spent in each function, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Also I came across something that I am not sure if the call is being done one or three time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;getScopeInWorld&lt;SPAN style="color: #000000;"&gt; =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;[ &lt;SPAN style="color: #0000c0;"&gt;convert&lt;/SPAN&gt;( x, scope, world, pos, 0,0,0 ) ,&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;convert&lt;/SPAN&gt;( y, scope, world, pos, 0,0,0 ) ,&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;convert&lt;/SPAN&gt;( z, scope, world, pos, 0,0,0 ) ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print( [&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;getScopeInWorld[0],&amp;nbsp;&lt;SPAN&gt;getScopeInWorld[1],&amp;nbsp;getScopeInWorld[2] ] )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is &lt;SPAN style="background-color: #f6f6f6;"&gt;getScopeInWorld&lt;/SPAN&gt;&amp;nbsp;evaluated three time or one time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 11:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427440#M5865</guid>
      <dc:creator>DaveLajoie</dc:creator>
      <dc:date>2020-07-17T11:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Profiling / Performance tuning: how to?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427441#M5866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, sorry, we don't have any built-in profiling tools for cga.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your particular example, &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getScopeInWorld&lt;/SPAN&gt; is considered a function, which is evaluated in every call.&amp;nbsp; So, it is evaluated 3 times, meaning &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;convert&lt;/SPAN&gt; is evaluated 9 times.&amp;nbsp; Putting a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;const&lt;/SPAN&gt; in front of it will ensure that it is only evaluated once.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/help/help-rules-functions.htm" title="https://doc.arcgis.com/en/cityengine/latest/help/help-rules-functions.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;CGA functions—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-const-keyword.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-const-keyword.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;const keyword—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Debugging tip&lt;/STRONG&gt;:&amp;nbsp; You can put a print statement around the array in the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;getScopeInWorld&lt;/SPAN&gt; definition, and you will see it is printed 3 times (plus a fourth time for the final print statement in your code above).&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;getScopeInWorld = 
   print(
      [convert(x, scope, world, pos, 0, 0, 0),
       convert(y, scope, world, pos, 0, 0, 0),
       convert(z, scope, world, pos, 0, 0, 0)]
   )
‍‍‍‍‍‍‍‍‍‍‍‍‍
print( [getScopeInWorld[0], getScopeInWorld[1], getScopeInWorld[2]] )‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427441#M5866</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2021-12-11T19:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Profiling / Performance tuning: how to?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427442#M5867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tx!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a const might help indeed, however will it be constant per shape or for the entire rule evaluation? I guess I should be able to test this myself know that I know that I can put a print statement in a function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will test and let you know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 19:00:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427442#M5867</guid>
      <dc:creator>DaveLajoie</dc:creator>
      <dc:date>2020-07-20T19:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Profiling / Performance tuning: how to?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427443#M5868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;somehow the const statement prevents print statement...&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;getScopeInWorld =&amp;nbsp;&lt;/P&gt;&lt;P&gt;print(&lt;BR /&gt; [convert(x, scope, world, pos, 0, 0, 0),&lt;BR /&gt; convert(y, scope, world, pos, 0, 0, 0),&lt;BR /&gt; convert(z, scope, world, pos, 0, 0, 0)]&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;const getConstScopeInWorld = &lt;BR /&gt; print(&lt;BR /&gt; [convert(x, scope, world, pos, 0, 0, 0),&lt;BR /&gt; convert(y, scope, world, pos, 0, 0, 0),&lt;BR /&gt; convert(z, scope, world, pos, 0, 0, 0)]&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;SplitXZ--&amp;gt;&lt;BR /&gt; alignScopeToAxes(y)&lt;BR /&gt; split( x, noAdjust ){ 10 : SplitZ }*&lt;BR /&gt; &lt;BR /&gt;SplitZ--&amp;gt;&lt;BR /&gt; split( z, noAdjust ){ 10 : Cell( getConstScopeInWorld ) }*&lt;/P&gt;&lt;P&gt;Cell( point )--&amp;gt;&lt;BR /&gt; point&lt;BR /&gt; color( rand(), rand(), rand() )&lt;BR /&gt; X.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 19:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427443#M5868</guid>
      <dc:creator>DaveLajoie</dc:creator>
      <dc:date>2020-07-20T19:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Profiling / Performance tuning: how to?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427444#M5869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a future release (2020.1), printing a const will work, but it doesn't work yet in 2020.0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2020 09:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-profiling-performance-tuning-how-to/m-p/427444#M5869</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2020-07-29T09:03:36Z</dc:date>
    </item>
  </channel>
</rss>

