Enjoy Every Sandwich

Thoughts on SQL, XML, .NET and sometimes beer.

<October 2008>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678


Navigation

Tools

List O'Links

Kent's Other Stuff

Subscriptions

News

Please read these
Notices and Disclamiers

Post Categories

Article Categories



Regex.CompileToAssembly... why?

I'm writing a little tool for one of my co-workers to parse the IIS logfiles for our public web site into traffic into two piles: traffic coming from our internal networks and everything else. While it's fairly easy, I'm finding that I've got about ten regular expression that I need to run each client IP address through. My program works OK, but it seems like its a bit slow. I'm only processing about 2,000 records per second from an USB 2.0 hard-drive and I've defragemented it. My thought is that the bulk of the processing time is going to into the comparison process. So I start poking around in the MSDN library and I see this .CompileToAssembly method. Not much help. I also Google on said and find a couple of interesting articles:

Why both of these examples are great demonstrations of how to use the method, neither are very good at why I would want to. Ideally, I'd like to see something that tells me if this is likely to be a good investment of my time to program in. I don't want to be a cargo culturalist, after all.

While "I contrive that the office of sense shall only be to judge of the experiment, and that the experiment itself shall judge of the thing," I don't want to bet my (Francis) Bacon on that effort today.

[Listening to: Numb as a Statue - Warren Zevon - The Wind (04:09)]

posted on Wednesday, March 03, 2004 8:32 AM by ktegels





Powered by Dot Net Junkies, by Telligent Systems