Amdahl’s Law : Big Speedups From Bigger Fractions

Does everyone know Amdahl’s Law?  This law talks about the best gain you can hope to achieve by a certain class of improvement.  The most common place that it’s used is in talking about what gains you might be able to get from making your algorithms more parallel (adding CPUs).  The main variables are “s”…

4

Exciting changes for me

I’ve changed jobs.  Well, sort of For the Whidbey product release I was the performance architect on the CLR, and I can’t even start to tell you how much fun that was.  And how educational it was. So the bad news is I’m not doing that anymore. But the good news is that The Powers…

16

Performance Quiz #8 — The problems with parsing — Part 5

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 parser.  This version is very similar to the last except now it’s…

6

parser_jitting.cs

// parser_jitting.cs // this program is offered as is with no warranty implied and confers no rights. using System;using System.Collections.Generic;using System.Text;using System.Reflection;using System.Reflection.Emit; namespace ParserJitting{    public class Program    {        // a few sample predicates, we will use these in a loop to simulate more of them        private static string[] predicates = {                “fact1”,                “fact2”,                “fact3”,                “fact2 &…

0

Performance Quiz #8 — The problems with parsing — Part 4

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 extra allocations. I suggested a plan like this one: preparse the…

5

parser_compiling.cs

// parser_compiling.cs // this program is offered as is with no warranty implied and confers no rights. using System;using System.Collections.Generic;using System.Text; namespace ParserCompiling{    class Program    {        // a few sample predicates, we will use these in a loop to simulate more of them        private static string[] predicates = {                “fact1”,                “fact2”,                “fact3”,                “fact2 & fact1”,                “fact3 &…

0

Performance Quiz #8 — The problems with parsing — Part 3

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 customer experience needs to be, what the key…

8

Performance Quiz #8 — The problems with parsing — Part 2

There were some great comments from the initial posting which I encourage you to read.  Many people latched on to the fact that GetToken(…) is doing a whole lot of allocations which is not something you generally want to see in a low level parsing function.  That was very high on my own list of…

13

Performance Quiz #8 — The problems with parsing — Part 1

I think I like parsers too much, I end up writing about them a lot.  Maybe that’s because about one program in three is, loosely speaking, a parser of some kind.  All the more reason why we should be very good about writing them. Unlike some of my previous quizes I’m not exactly sure where…

19

parser_original.cs

// parser_original.cs // this program is offered as is with no warranty implied and confers no rights. namespace ParserOriginal{    class Program    {        // a few sample predicates, we will use these in a loop to simulate more of them        static string[] predicates = {                “fact1”,                “fact2”,                “fact3”,                “fact2 & fact1”,                “fact3 & fact2”,                “fact4 | fact5”,                “!fact4…

0