<?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: Optimization of the code in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7308173#M30087</link>
    <description>&lt;P&gt;Generic question, generic answers: the two most common problems I run into are loops and data management.&amp;nbsp; Don't loop when you don't have to, skip or even stop looping wherever possible.&amp;nbsp; Don't work with "big data", just as you don't put all your work in a single file and instead&amp;nbsp;use smaller XREFs, work with lots of "small data".&amp;nbsp; Structure it to support short-circuit looping.&amp;nbsp; Also choose an appropriate data format and location - a CSV file is OK for a couple hundred lines of data but for a few million you're going to need a database.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 14:48:26 GMT</pubDate>
    <dc:creator>dgorsman</dc:creator>
    <dc:date>2017-08-17T14:48:26Z</dc:date>
    <item>
      <title>Optimization of the code</title>
      <link>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7307490#M30085</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I code using c#, ObjectARX and AutoCAD .NET API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In many functions i need to use big data so they take a long time (sometimes hours), i thought about optimizating the code, is there any method to do that using these technologies ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that using a lot of transactions in the same function can contribute in that. is there any other advice&amp;nbsp;in this direction to have an optimal code with the minimal time of execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 11:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7307490#M30085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-17T11:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization of the code</title>
      <link>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7307981#M30086</link>
      <description>&lt;P&gt;This is an extremely broad and general development question that has no definitive answer as it completely depends on your individual code base. &amp;nbsp;The only thing I can think of doing is debugging your software and finding areas in your software that are taking the longest to complete their operations. &amp;nbsp;You can also use the Stopwatch class in .NET (System.Diagnostics.Stopwatch) to set timers around certain events that you might feel are suspect. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you find those areas it will be up to you to determine how it can be reorganized/restructured to operate more efficiently, if that is even possible. Again, this is something that is completely dependent on YOUR code base and there really isn't a 'one-size-fits-all' solution to this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 13:58:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7307981#M30086</guid>
      <dc:creator>mhillis</dc:creator>
      <dc:date>2017-08-17T13:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization of the code</title>
      <link>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7308173#M30087</link>
      <description>&lt;P&gt;Generic question, generic answers: the two most common problems I run into are loops and data management.&amp;nbsp; Don't loop when you don't have to, skip or even stop looping wherever possible.&amp;nbsp; Don't work with "big data", just as you don't put all your work in a single file and instead&amp;nbsp;use smaller XREFs, work with lots of "small data".&amp;nbsp; Structure it to support short-circuit looping.&amp;nbsp; Also choose an appropriate data format and location - a CSV file is OK for a couple hundred lines of data but for a few million you're going to need a database.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 14:48:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7308173#M30087</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2017-08-17T14:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization of the code</title>
      <link>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7309166#M30088</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a lot of question about this that you should answer&amp;nbsp;: First of all, where is your "big data"? in a file, in a db server (which one?), cloud, etc. &amp;nbsp;then how big is it? , how big are the average result sets? What kind of data (numbers, strings, spatial, etc) &amp;nbsp;Depending on the answers you can check for some things to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.-If files, then you can split/merge the data in smaller&amp;nbsp;or bigger files depending on read frequency and read speed, memory access, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.-If data base, you can check if the indexes are well created, poor indexing is the primary factor in data access performance. If they are ok, then changing to a in-memory db engine may be an alternative (see&amp;nbsp;&lt;A href="http://www.h2database.com/html/performance.html" target="_blank"&gt;H2&lt;/A&gt;&amp;nbsp;database engine as an example of in-memory db engine)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3.-De-normalization, some times you need to de-normalize a structure in order to achieve a better performance, usually the third normal form (3NF) suffice the needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4.-Using a bad type of cursors in SQL Server may change all, IOW check that you are using the correct cursor in a stored procedure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5.-Stored procedure with bad filtering, if your data it's in a SQL Server, check the execution plan, it give you some hint on performance. That apply to indexing too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6.- If you are dealing with spatial data, check you are using the proper structure to store or retrieve the data. Also SQL server use a b-tree to index spatial data, &amp;nbsp;it's slower than a quad tree.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7.-String management, string concatenation operator it's slower than using the string builder class concatenate method in .NET, as string class objects are immutable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;8.-String search using regular expressions could be very slow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;8.- Search for the correct structure that you need in code, in .NET there are lots of different kind of &amp;nbsp;lists, arrays, dictionaries, etc. each one performing different with the same method, so do some research on that topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a lot that can be do, but we need more info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 19:38:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/optimization-of-the-code/m-p/7309166#M30088</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2017-08-17T19:38:45Z</dc:date>
    </item>
  </channel>
</rss>

