Friday, May 6, 2011

SortedDictionary ...

NaroCAD uses in a lot of instances SortedDictionary and of course this is rarely needed. The reason using it for that many times, is to have good performance profile. For who knows O(log n) search time, knows that performance of lookups is scalable in time with number of digits of the search entries.
But in a lot of cases this is not needed (to have items sorted by key) and as someone informed me, I will use Dictionary generic class instead in future.
Relevant quote:

"Retrieving a value by using its key is very fast, close to O(1), because the Dictionary class is implemented as a hash table." Looks like the query time for Dictionary is O(1), but the query time for SortedDictionary is O(logn) -- "The SortedDictionary generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this respect, it is similar to the SortedList generic class. The two classes have similar object models, and both have O(log n) retrieval. Where the two classes differ is in memory use and speed of insertion and removal."
So, for your better writing code, use Dictioary always.
Fixes are made lately so most of your Boo scripts will work as sketch code is automatically handled, more shapes will also work. Dangling texture rectangles shown in preview of automatic constraints were fixed and are display and will disappear at the end of your design. There is a crash of .Net/C++ memory management that will be fixed before release in this area.

No comments: