Few patches you may need to use for this lab:
|
Wednesday, August 15, 2007
DEV012 Building WPF XAML Browser Applications - few patches
Thursday, August 09, 2007
Consolas - ClearType font optimized for programming environment
Few patches you may need to use for this lab:
|
Wednesday, August 08, 2007
WCF Performance
| Some time ago I've developed a Comet infrastructure for the ASP.NET Ajax. As part of its possibilities - it enables to serialize server-side objects and stream them to the handling function at client side. It was working like a breeze, until Ive streamed some object with Date field, say something like that: public class TestMessage { public string _s1 = "s1"; public int _i1 = 1; public DateTime _t1 = DateTime.Now; } Now, an instance of this TestMessage was correctly deserialized into JS object, exclude its DateTime fields, which was appearing in following form: {...} _i1: 1 _s1: "s1" _t1: "/Date(777)/" If youre affected by similar problem here is the reason: 1) JSON representation for the string was changed from @777@ to \/777\/ in the latest Ajax release (to prevent serialization of strings that looks like date into Date format), where 777 is num of milliseconds since January 1, 1970 UTC. 2) Currently - at the server side DateTime object is serialized as "_t1":"\/Date(777)\/" 3) If you stream it as-is to the client-side JS recognizes single \ as escape character and your date actually became /Date(777)/, which is wrong format for deserialization. So, if you want to stream your objects correctly you here is small RegEx-based utility Ive did for it: private static class ReplaceDateOrchestrationRegularExpression { private const string _regex = "(? private static readonly RegexOptions _options = ((RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline) | RegexOptions.IgnoreCase); public static readonly Regex Expression = new Regex(_regex, _options); public const string ReplaceOptions = @"${prefix}${firstDateSlash}\${body}${secondDateSlash}\${postfix}"; } private static string ConvertToClientSideJson( string jsonedArgument ) { return ReplaceDateOrchestrationRegularExpression.Expression.Replace( jsonedArgument, ReplaceDateOrchestrationRegularExpression.ReplaceOptions); } |
Errors in PageFlowInstanceStore.sql when installing DB for PageFlowQuickstart in WCSF
When trying to install PageFlowQuickstart.sql to create DB for the PageFlowQuickstart of WCSF I've encountered the following errors:
If you're getting hit by this problem - here is the reason: whole SQL script is written in assumption that DB collation is case-insensitive. Just fix the letters case ( @InstanceId instead of @instanceId , etc.) and you have it fixed. |
Tuesday, August 07, 2007
How to keep Format Painter active in Office-style applications...
| Here is the trick - double click the format painter icon to format multiple elements. Press ESC to end formating. |
Monday, July 30, 2007
Free e-book: Rapid C# Windows Development
| "Rapid C# for Windows Development" by Joseph Chancellor is available (in .pdf format) for free download from LLBLGen Pro site. |
Monday, July 16, 2007
Benchmarking LINQ vs. DAAB vs. ADO.NET
| Abstract: This article presents benchmarking results of performance of SP calls using LINQ, Data-access application block and ADO.NET. Some time ago I was doing LINQ performance benchmarking, looking for an option of replacing our existing data layer with it. One thing that was especially important for me to check - was performance of executing SP's. The reason is that most of our DAL logic resides in SP's at one hand and that performance-critical parts are implemented as SP's as well (for all the good reasons, like possibility to benefit from queries compilation etc). Below are performance benchmarking results of execution uspGetManagerEmployees SP from AdventureWorks DB. (Basically it does some sort of JOIN to retrieve records of employees data for the specified Manager ID). I tested three data-access models - raw ADO.NET vs. DAAB (our current DAL workhorse) vs. LINQ (May 2006 preview version). As a prerequisite for running this test you'll need AdventureWorks DB and installation of LINQ. Few side-notes:
So here goes the test code: 1. Plain ADO.NET:
2. DAAB (Data Access Application Block):
3. LINQ (using ORM layer produced by SQLMetal.exe - "c:\Program Files\LINQ Preview\Bin\SqlMetal.exe" /server:. /database:AdventureWorks /pluralize /sprocs /code:AdventureWorks.cs):
Here are timing results of this benchmarking test:
![]() Results So, comparing to the raw ADO.NET - DAAB is 8% slower and LINQ is 28% slower. Comparing to DAAB - LINQ is 18% slower. CPU usage intensity is about 2% average for raw ADO.NET vs. about 8% for DAAB vs. about 20% for LINQ - order of magnitude worse than raw ADO.NET (CPU graphs captured with perfmon below). ![]() Fig. 1 ADO.NET - CPU usage ![]() Fig. 2 DAAB - CPU usage ![]() Fig. 3 LINQ - CPU usage In overall - this performance overhead is quite disappointing. I still consider to use LINQ, as we have DAL/BLL servers in our architecture, which we may merely upgrade to faster hardware, while isolating thin-client computers from this performance overhead. I think it's a big challenge for the LINQ team to address its performance. |
Subscribe to:
Posts (Atom)



