Brian (VSTS Product Group Manager) in his recent post published the TFS 2008 feature list. I am very happy to see some of the features specially support for SPS 2007 and SQL reporting on any server.
My organization already deployed a SPS 2007 and SQL Reporting 2005 server farms in addition to the SQL Server 2005 farm hosting our data marts and RDBMS databases. TFS 2008 will enable us to leverage the existing infrastructure rather than build all the infrastructure from scratch. The cost of deploying/maintaining TFS 2008 will be much less than setting up a dedicated high availability environment.
The only thing I am still looking for answers is the support for 64 bit OS in TFS 2008. Unfortunately the TFS 2005 middle tier was not supported on 64 bit OS. I hope TFS 2008 will be supported on a 64 bit environment. I will try to install it on a virtual machine and see if that works.
Wednesday, August 15, 2007
Boxing/UnBoxing Continued
Since my last post I ran across some new questions.
1. Does boxing have a performance issue or UnBoxing?
2. In case when an int has to be concatenated with string is it better to use ToString() method.
After running some tests I have concluded.
Boxing is slower than UnBoxing and ToString() is slower than boxing. So if one cannot avoid boxing do not try to use ToString() methods they seem to be slower.
My current challenge is that I have a Winform screen with 15 drop downs and 6 grids. In order to bind the the controls I am converting strongly typed Business entities to DataTables. There are quite a few properties in the business entities which are int and DateTime resulting in boxing and impacting the performance of the screens.
Hopefully I will come up with a solution to this issue soon.
1. Does boxing have a performance issue or UnBoxing?
2. In case when an int has to be concatenated with string is it better to use ToString() method.
After running some tests I have concluded.
Boxing is slower than UnBoxing and ToString() is slower than boxing. So if one cannot avoid boxing do not try to use ToString() methods they seem to be slower.
My current challenge is that I have a Winform screen with 15 drop downs and 6 grids. In order to bind the the controls I am converting strongly typed Business entities to DataTables. There are quite a few properties in the business entities which are int and DateTime resulting in boxing and impacting the performance of the screens.
Hopefully I will come up with a solution to this issue soon.
Wednesday, August 08, 2007
Boxing/Unboxing
Its been nearly three years since I last blogged and what better topic to start blogging back again than boxing/unboxing.
Most of the literature that I can find online tells me what is a boxing/unboxing operation or what are its disadvantages but none could definitively answer to the question that came up during a recent code review. Whether this code causes boxing/unboxing
class Class1
{
int i = 10;
static void Main(string[] args)
{
Class1 x = new Class1();
int a = x.i; //unboxing??
x.i= 20; //boxing??
}
}
I myself when initially came across the concept of boxing/unboxing used to think that the above code will cause box and unbox operations to be called but that's not the case. The above code does not cause boxing/unboxing.
The idea of boxing unboxing is a little little difficult to grasp and I have found lots of people(including myself) struggling with it. There is an article on type fundamentals by Jeffrey Richter which may help explain things and also there is a blog post by David Cumps which gives a nice visual explanation of boxing/unboxing
To figure out in the C# code if it has any box operation look for the following
- An instance of a value type is assigned to a variable/field/property of the type object
- An instance of a value type is cast to an instance of an object type
- An instance of a value type is passed to a method/property indexer which has object type as a parameter.
To figure out in C# code if it has any Unbox operation check whether an instance of a type object is being cast to an instance of a value type.
Below are the few common cases of boxing and unboxing
int j;
int i = 10; // can be any value type like float, double, Point, DateTime, structures etc.
//The standard example
object o = i; //implicit boxing
o = (object)i; //explicit boxing
j = (int)o; //unboxing
//String.Format and its variations
string.Format("Boxing {0}",i); //implicit boxing
Console.WriteLine("Boxing {0}",i);
StringBuilder strBuild = new StringBuilder();
strBuild.AppendFormat("Boxing {0}",i); //implicit boxing
//Collections
ArrayList list = new ArrayList();
list.Add(i); //implicit boxing
list.BinarySearch(i); //implicit boxing
list.IndexOf(i); //implicit boxing
list.Insert(2,i); //implicit boxing (only for i)
list.LastIndexOf(i); //implicit boxing
list.Remove(i); //implicit boxing
j = (int) list[0]; //unboxing
Hashtable coll = new Hashtable();
coll.Add(i,i); //implicit boxing(twice)
coll.Contains(i); //implicit boxing
coll.ContainsKey(i); //implicit boxing
coll.ContainsValue(i); //implicit boxing
coll.Remove(i); //implicit boxing
j = (int) coll[i]; //implicit boxing for indexer and unboxing for assignment
//DataTable
DataTable dt = new DataTable();
dt.Columns.Add("UntypedColumn");
dt.Columns.Add("IntColumn",typeof(int));
DataRow dr = dt.NewRow();
dr["UntypedColumn"] = i; //implicit boxing
dr["IntColumn"] = i; //implicit boxing
j = (int) dr["UntypedColumn"]; //unboxing
j = (int) dr["UntypedColumn"]; //unboxing
Friday, October 15, 2004
Pre-compilation in ASP.NET v1.1
Today I came across Jon Galloway’s blog entry on pre-compiling ASP.NET web applications in v1.1. I have been looking for this for a while now. I tried it on with the web application I am currently developing on my development machine (Win XP Professional).
And here are the observations.
1. The handler compiles all the aspx files in the folder irrespective whether the file is part of your project. This was very troublesome for me as on my development machine there existed old aspx files which were removed from source control but they existed on my disk.
2. If an error occurs during compilation of a page the compilations stops and no other pages are compiled. Aspx pages are not classes which refer each other I think if a error occurs on a page that page should be skipped and the next page should be compiled and the list of pages which caused errors should be generated. For each time an old aspx file (no longer used in the project) was found I had to go and delete it and wait for the next error page.
3. If an error occurs during compilation and is then corrected. Restarting the pre-compilation doesn’t work. One needs to re-start the ASP.NET worker process for the compilation to work. That’s a major issue. We cannot keep on restarting the worker process each time we encounter an error during pre-compilation.
4. The handler only compiles the aspx files (and all the ascx user controls refrenced in the aspx ) in the specified folder not in all aspx pages the in the web application. In case one is developing a large website and the aspx pages are grouped in different folders one has to go to each folder for the pages to compile.
5. In my case I had forms authentication enabled so the ways I could make pre-compilation work is to either disable forms authentication for the time I am pre-compiling or through web.config grant access to the handler in each folder. Neither can be used for production environments as changing the web.config after compilation will cause the aspx to be recompiled by the runtime. The other smart thing would be login the website and the call the pre-compile page. But none of these solutions are good enough. The handler should behave something like the debug works. I can configure whether debug information is available on remote machines or only on local machines. Similarly I should be able to configure that I can make a pre-compilation request from a remote location or from a local machine. And an authorization mechanism where I can grant access to pre-compilation easily rather then listing out each folders in which pre-compilation is allowed
Overall the handler has still some issues and is very primitive to be used in an actual production environment. I think that’s the reason the handler has not been advertised. I fell its better that I wait for the ASP.NET v2.0 and see if it is good enough to be used in a production environment.
And here are the observations.
1. The handler compiles all the aspx files in the folder irrespective whether the file is part of your project. This was very troublesome for me as on my development machine there existed old aspx files which were removed from source control but they existed on my disk.
2. If an error occurs during compilation of a page the compilations stops and no other pages are compiled. Aspx pages are not classes which refer each other I think if a error occurs on a page that page should be skipped and the next page should be compiled and the list of pages which caused errors should be generated. For each time an old aspx file (no longer used in the project) was found I had to go and delete it and wait for the next error page.
3. If an error occurs during compilation and is then corrected. Restarting the pre-compilation doesn’t work. One needs to re-start the ASP.NET worker process for the compilation to work. That’s a major issue. We cannot keep on restarting the worker process each time we encounter an error during pre-compilation.
4. The handler only compiles the aspx files (and all the ascx user controls refrenced in the aspx ) in the specified folder not in all aspx pages the in the web application. In case one is developing a large website and the aspx pages are grouped in different folders one has to go to each folder for the pages to compile.
5. In my case I had forms authentication enabled so the ways I could make pre-compilation work is to either disable forms authentication for the time I am pre-compiling or through web.config grant access to the handler in each folder. Neither can be used for production environments as changing the web.config after compilation will cause the aspx to be recompiled by the runtime. The other smart thing would be login the website and the call the pre-compile page. But none of these solutions are good enough. The handler should behave something like the debug works. I can configure whether debug information is available on remote machines or only on local machines. Similarly I should be able to configure that I can make a pre-compilation request from a remote location or from a local machine. And an authorization mechanism where I can grant access to pre-compilation easily rather then listing out each folders in which pre-compilation is allowed
Overall the handler has still some issues and is very primitive to be used in an actual production environment. I think that’s the reason the handler has not been advertised. I fell its better that I wait for the ASP.NET v2.0 and see if it is good enough to be used in a production environment.
Thursday, September 16, 2004
The Debate: Should we set the value of a variable to Null after we have no use for it
Its been a long standing debate. I have found many developers setting the value of the local variables to null at the end of the method. That never made sense why should one set the value of a variable to null which will anyway be out of scope in the next line of code and will be garbage collected. It never made sense and it never will.
But Rico Mariani in his post Mid life crisis has pointed out a scenario where setting the value of the variable that are no longer used to null can be useful. But as he pointed out it in the post it needs to be done before we pass the task to some other thread and we know the variable is dead and will not be used in later processing. To understand in detail one must go through the article in detail and check out how the .Net Garbage Collector(GC) works.
learned something really interesting and useful today.
But Rico Mariani in his post Mid life crisis has pointed out a scenario where setting the value of the variable that are no longer used to null can be useful. But as he pointed out it in the post it needs to be done before we pass the task to some other thread and we know the variable is dead and will not be used in later processing. To understand in detail one must go through the article in detail and check out how the .Net Garbage Collector(GC) works.
learned something really interesting and useful today.
MSDN 2 is here
Microsoft has released the beta-documentation for Visual Studio 2005. I came to know about this from Krik Allen Evans's post MSDN2 and .NET Namespace Support cool new features and a different look I really find the namespace URL feature interesting, it can be very useful.
Sunday, May 30, 2004
Another excellent analogy this time on .Net Remoting
A fabulous post on Marshal-by-ref versus Serializable Objects by Eric Lippert. I need to learn how people come up with such excllent analogies and simple explanation to complex things.
re:The Fishbowl: The Mac is a Harsh Mistress
Charles Miller has really written a excellent and funny analogy comparing Mac/Microsoft/Linux. He shows good knowledge two very complex things females and computers ;).
Longhorn and Loosing your mobile phone
In a recent post I lost my girlfriends phone number. Kevin Moore is very right in saying "Loosing your phone should be a great experience, because it gives you an excuse to get a Pocket PC Phone Edition". And I really look forward to the day where I am not worried upset at loosing my address book and spending enormous amount of time trying to back it up in an excel sheet and keeping it in Sync.
His idea of a unified Address books sounds nice but I still wonder how will they make it possible in Longhorn and how much it will cost as there are many devices today which offer softwares to communicate with the PC and backup the data, but need costly data cables other communication infrastructure.
His idea of a unified Address books sounds nice but I still wonder how will they make it possible in Longhorn and how much it will cost as there are many devices today which offer softwares to communicate with the PC and backup the data, but need costly data cables other communication infrastructure.
It feels good to be heard
Few days back I posted my comment to a post Why don't nullable relational operators return bool? instead of bool? on the C# Frequently Asked Questions blog. In response the comment the C# Team updated the post. Its really nice to know that you are being heard.
Friday, May 28, 2004
Some useful links
Recently a collegue of mine needed some help with Creating a Windows Service, Creating an MSI Installer and Updater Application Block for .NET. Being in the middle of a project he prefered something a simple not the boring comprehensive resources from MSDN. Having used all these in my earlier projects more that an year ago, I had a tought time then finding quality resources to help me understand exactly how to use them. MSDN Was the only good place i could find something good. But yesterday when i started searching on the net for some good stuff I was amazed to see how many new resoruces are available. I compiled a list of link which he can use. I would like to share with everybody who may be interested in these.
Updater Application Block for .NET
Downloads
http://microsoft.com/downloads/details.aspx?FamilyId=C6C17F3A-D957-4B17-9B97-296FB4927C30&displaylang=en
How-To
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=181256
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=158337
http://www.ballzac.com/updaterblock/Updater%20Application%20Block%20HOW-TO%20generic.htm
The Gotdotnet community Workspace
http://www.gotdotnet.com/Community/Workspaces/workspace.aspx?id=83c68646-befb-4586-ba9f-fdf1301902f5
The nuts and bolts
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp
http://builder.com.com/5100-6373-5080375.html
news://msnews.microsoft.com/microsoft.public.dotnet.distributed_apps
http://www.microsoft.com/downloads/details.aspx?FamilyId=5B7C6E2D-D03F-4B19-9025-6B87E6AE0DA6&displaylang=en
Windows Service
Walkthrough
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughcreatingwindowsserviceapplication.asp
Tutorial
http://www.c-sharpcorner.com/2/window_service.asp
History & Geography (Architecture and related stuff)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp
MSI Installer in .Net
Tutorial
http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp
http://www.devarticles.com/c/a/C-Sharp/Creating-a-.NET-Windows-Installer--Part-1/
The nuts and bolts
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbcondeployingsolution.asp
Unfourtunately, a majority of links are still from MSDN ;)
Updater Application Block for .NET
Downloads
http://microsoft.com/downloads/details.aspx?FamilyId=C6C17F3A-D957-4B17-9B97-296FB4927C30&displaylang=en
How-To
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=181256
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=158337
http://www.ballzac.com/updaterblock/Updater%20Application%20Block%20HOW-TO%20generic.htm
The Gotdotnet community Workspace
http://www.gotdotnet.com/Community/Workspaces/workspace.aspx?id=83c68646-befb-4586-ba9f-fdf1301902f5
The nuts and bolts
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp
http://builder.com.com/5100-6373-5080375.html
news://msnews.microsoft.com/microsoft.public.dotnet.distributed_apps
http://www.microsoft.com/downloads/details.aspx?FamilyId=5B7C6E2D-D03F-4B19-9025-6B87E6AE0DA6&displaylang=en
Windows Service
Walkthrough
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughcreatingwindowsserviceapplication.asp
Tutorial
http://www.c-sharpcorner.com/2/window_service.asp
History & Geography (Architecture and related stuff)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp
MSI Installer in .Net
Tutorial
http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp
http://www.devarticles.com/c/a/C-Sharp/Creating-a-.NET-Windows-Installer--Part-1/
The nuts and bolts
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbcondeployingsolution.asp
Unfourtunately, a majority of links are still from MSDN ;)
Tuesday, May 25, 2004
MSDN Lab
Stumbled upon MSDN Lab while checking out the Visual Studio Team System site. It seems Microsoft is taking a tip or two from google which has its own labs website where it previews its upcoming/under development products/features.
Subscribe to:
Posts (Atom)