Browse by Tags

All Tags » Algorithms » Whidbey (RSS)

Array.Resize is a pretty cool little tool. Copy hints might be a nice addition?

If you normally use the supporting collections, this won't be much of a toy for you. If you rely on arrays, and lots of them, and find yourself resizing them every now and then with little helper functions or inline resize code, then you should check...
Posted by Justin Rogers | with no comments

Performance: Refactoring generic List.RemoveAll... Speed lost in implementation and Array.Clear...

Well, I got railed after my previous posting on the List.RemoveAll method How is that RemoveAll method on the generic List actually implemented? . Apparently I'm not allowed to make basic comments anymore, and I quote "Now your remark is just information...

How does List<T>(IEnumerable<T>) avoid the costs of expanding the internal collection?

The interface IEnumerable<T> is just like the old interface IEnumerable. It allows a single method GetEnumerator which returns an IEnumerator<T>. This second interface has the property Current and a method for moving the index MoveNext . As...

How is that RemoveAll method on the generic List actually implemented?

We get lots of removal methods for the List<T> in Whidbey. You can Remove(T), or the first instance of some object or value. You an RemoveAt(int) and take something out of a given offset. You can even RemoveRange(int, int) and take out a whole group...

Performance: Whidbey generic Queue didn't get hit with the same performance stick as the generic Stack

I think I've narrowed down the new Whidbey generic Stack class to using a linked array Performance: Linked Arrays's now and later . I figured, hey, they must have used the same features in the Queue right? Not quite, in fact the generic queue can actually...

Performance: Linked Arrays's now and later

I love testing my code against the latest and greatest available in Whidbey. Turns out there are some collections that are insane when it comes to performance. One such collection is the generic Stack and of course the new Queue. Now both of these new...

Performance: Focusing on BinarySearch

If you take a look through Rotor you'll find a number of methods that have the signature TrySZ[...]. What these methods are meant to do is take intrinsic data types (int, float, long, etc...) and perform faster than normal operations on them. That is...

Adding generics to the Phone Teaser project...

I just really felt like adding generics to the mix and timing them against the old method. Unfortunately I don't have a dictionary large enough to really make decent timings and I'm not all that worried about finding a better one. I really enjoy rewriting...
Posted by Justin Rogers | with no comments
Filed under: ,

I'm going to do something unfair to make a point: int.TryParse versus DWC.NumberUtilities.

Note this is a completely unfair test because Whidbey is in Beta and all, but I'll throw it out there anyway. I went ahead and tested the original TryParseInt method (the completely unoptimized version that has been deprecated in the utility), against...

Lightweight Code Gen and mathematical equations.

Using lightweight code gen for dynamic scripting languages is cool and all, but imagine the possibilities for the language of mathematics. Sure you can try to write some generics that handle common tasks, perhaps a generic method or two, but lightweight...
More Posts