Performance
I love this type of thing, a whole post on optimal string reverse algorithms. I always love this sort of thing, learning huge amounts of detail about fundamental operations (sort of, umm when do you ever reverse strings?). Actually looking at Justin Rogers' blog he has lots of great performance posts...
I've written about this a few times now (use the search thingy to find where) but I'm still surprised how many people mess up the Singleton pattern. Â For instance take: if (blogSettingsSingleton == null) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â { Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â blogSettingsSingleton = new BlogSettings(); Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â } Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return blogSettingsSingleton; Â Looks ok, right? But this is a classic poor pattern when dealing with multi-threaded apps. Why? Look at the initial 'if' statement, and think what happens if multiple treads hit this at the same time...one thread...
Steven Smith has a great little article on ASPAllicance on comparing performance and methods of performing data access in .NET applications. Some really interesting techniques there, I especially like the IDataReader delegate example, a really nice solution to passing IDataReaders between layers in an app...
Just been reading this article on Codeproject.com...hmm...I have a few issues with how he does things:DataBinder.Eval - I have what is becoming an obsession about this now - there's just NO NEED for this in most cases, it sucks in terms of performance (you can typically lose about 20% compared to the stongly typed method. I've posted a couple of times about this here and here.OnItemDataBound - now, I've yet to do a benchmark comparing to member methods (just reminded myself actually, I might do one this weekend). I use to use this method all the time for nested repeaters...
I've posted about this topic a few times, it's really nice to see that someone has finally given a practical, free method of doing this. This implementation uses WS-E to do this, meaning that you add an attirbute to both the client and server portions of your web service - and there you have it, a compressed SOAP message!If you're using Web Services and transmitting any non-trivial amount of Data, I really do recommend that you use compression on the SOAP message (especially if you're sending DataSets, those buggers are huge when serialized - of course you can minimize them in...
A very common question in the ASP.NET Forumsis "How do I nest one Repeater (or DataList or DataGrid) inside of another?"; well, my usual stock answer used to be to use the OnItemDataBound event then use a FindControl() to find the Repeater inside the template and set it's datasource to the child view - then just DataBind...Recently though, I've gone against this - based in part on a bit in a book by Farhan Muhammad and Matt Milner (can't find the link to the exact book, but this one is pretty useful too), essentially, it involves using a member method....
Well, still at it (20 hours after starting - yes, the time on this post is correct!). Really fustrating mostly, but one of those times coding where hours and hours of pain (literally in this case - flu and splitting headaches were involved) were followed by a sudden dawning then a solution.Well, I've learnt more about Load Testing and SQL Server performance today than I had in the previous 2 years, lessons I've learnt:SQL Profiler is god's own tool (not in any nasty sordid way, in a good way) - use it, love it! If you're running a load test,...