Browse by Tags

Performance Quiz #13 -- Linq to SQL compiled query cost -- solution
14 January 08 09:51 AM | ricom | 18 Comments   
Well is there really a "solution" at all in general? This particular case I think I constrained enough that you can claim an answer but does it generalize? Let's look at what I got first, the raw results are pretty easy to understand. The experiment I Read More...
Filed under: , ,
Performance Quiz #13 -- Linq to SQL compiled queries cost
11 January 08 12:08 PM | ricom | 28 Comments   
I've written a few articles about Linq now and you know I was a big fan of compiled queries in Linq but what do they cost? Or more specifically, how many times to you have to use a compiled query in order for the cost of compilation to pay for itself? Read More...
Filed under: , ,
Performance Quiz #12 -- The Cost of a Good Hash -- Solution
26 January 07 10:01 AM | ricom | 6 Comments   
Well once again there have been many thoughtful replies to both the original question as well as the followup with hints. Recall the original question asked a bit of trivia: could you name 5 implementations of GetHashCode in the framework that do things you might not expect to see in a hash function? It's a little bit of a vague question and also requires a good deal of arcane knowledge of the CLR. The most interesting thing about the discussion I think is just what people considered "unusual." But as always there was a method to my madness. So without further ado here's my list of "unusual" hash functions, there are 53 of them. Read More...
Filed under: ,
Performance Quiz #12 -- The Cost of a Good Hash -- Some Help
24 January 07 11:30 AM | ricom | 32 Comments   
I continue to be astounded by what my readers can come up with. As usual I had a purpose for posing my last question and that purpose was to show that basically its hard to get a handle on what things cost in any kind of omnibus way. But imagine my surprise Read More...
Filed under: , ,
Performance Quiz #12 -- The Cost of a Good Hash
22 January 07 11:38 AM | ricom | 28 Comments   
This quiz is a little bit different than some of my others. Here is System.String.GetHashCode public override unsafe int GetHashCode() { fixed (char* text1 = ((char*) this)) { char* chPtr1 = text1; int num1 = 0x15051505; int num2 = num1; int* numPtr1 Read More...
Filed under: ,
Performance Quiz #11: Ten Questions on Value-Based Programming : Solution
07 September 06 02:52 PM | ricom | 11 Comments   
In my last quiz I asked a few questions about a few hypothetical classes that might appear in a value-rich context. I styled my example in the form of some graphics library classes but the idea is a general one. Many contexts can and should be rich in Read More...
Filed under: ,
Performance Quiz #11: Ten Questions on Value-Based Programming
31 August 06 11:23 AM | ricom | 22 Comments   
Some of you have probably heard one or more of my talks, or read the annotations I made in the Design Guidelines . If you have then you already know that I don't always agree with every suggested guideline. Especially not in every context. It's probably Read More...
Filed under: ,
Performance Quiz #10 -- Thread local storage -- Solution
18 July 06 04:25 PM | ricom | 6 Comments   
I actually posted quiz #10 quite a while ago but a comment with the correct solution came in so quickly that I wasn't very motivated to post a followup. There are excellent links in the comments (thank you readers!) But now I'll have to make the quizzes Read More...
Filed under: ,
Performance Quiz #10 -- Thread local storage
16 June 06 12:55 PM | ricom | 8 Comments   
It's time for another quiz! A very short one this time. If I need some thread local storage and I might need several entries should I use: Thread.GetData(slot) and Thread.SetData(slot, object) or should I make my own static member like this [ThreadStatic] Read More...
Filed under: ,
Performance Quiz #9 -- extra innings due to dispatch stubs
21 March 06 05:37 PM | ricom | 1 Comments   
Well you'll recall that in the Performance Quiz #9 solution there was a surprising result where Test7 was actually faster than Test5 even though they appear to be doing basically exactly the same work. So my new challenge to you was to see if you can Read More...
Filed under: ,
Performance Quiz #9 : IList<T> List and array speed -- solution
12 March 06 09:46 AM | ricom | 8 Comments   
Last week I posted Performance Quiz #9 for discussion. Well the comments have been just awesome and many people went right ahead and measured the results. Some of you have discovered the key point in this particular test: Arrays are magic. In the test Read More...
Filed under: ,
Attachment(s): Program.cs
Performance Quiz #9 : IList<T> List and array speed
09 March 06 07:31 PM | ricom | 34 Comments   
A short and sweet quiz with lots of juicy discussion possibilities: public int Sum( IList < ushort > indices) { int result = 0; for ( int i = 0; i < indices.Count; i++) result += indices[i]; return result; } Considering only the time it takes Read More...
Filed under: ,
Performance Quiz #8 -- The problems with parsing -- Part 5
30 November 05 11:32 AM | ricom | 6 Comments   
And today we conclude our little saga with one final experiment, a little analysis and some comments. I hope you've enjoyed reading this series as much as I've enjoyed doing the experiments. First, as promised I created yet another version of this little Read More...
Filed under: ,
Performance Quiz #8 -- The problems with parsing -- Part 4
29 November 05 11:48 AM | ricom | 5 Comments   
In my last posting I made some recommendations about how to drastically improve the evaluation process based on the key observations that even the basic operations required to evaluate the truth of the facts were quite costly -- more so than all of the Read More...
Filed under: ,
Performance Quiz #8 -- The problems with parsing -- Part 3
28 November 05 11:53 AM | ricom | 8 Comments   
The thing about performance work is that it's very easy to be fooled into looking into the wrong areas. That's why you want your changes to be firmly grounded in data whenever they can be. Or if you're planning, you want to be thinking about what your Read More...
Filed under: ,
More Posts Next page »

Search

This Blog

Syndication

Page view tracker