Click here to Skip to main content
15,892,697 members
Home / Discussions / C#
   

C#

 
AnswerRe: Structure conversion Pin
Nick Parker16-Dec-05 6:02
protectorNick Parker16-Dec-05 6:02 
QuestionCount the number of rows with sqldatareader Pin
Genbox16-Dec-05 0:03
Genbox16-Dec-05 0:03 
AnswerRe: Count the number of rows with sqldatareader Pin
J4amieC16-Dec-05 0:26
J4amieC16-Dec-05 0:26 
GeneralRe: Count the number of rows with sqldatareader Pin
Genbox16-Dec-05 1:00
Genbox16-Dec-05 1:00 
GeneralRe: Count the number of rows with sqldatareader Pin
J4amieC16-Dec-05 1:22
J4amieC16-Dec-05 1:22 
GeneralRe: Count the number of rows with sqldatareader Pin
Genbox17-Dec-05 3:49
Genbox17-Dec-05 3:49 
QuestionTool to detect boxing/unboxing? Pin
LiamD15-Dec-05 23:05
LiamD15-Dec-05 23:05 
AnswerRe: Tool to detect boxing/unboxing? Pin
Heath Stewart16-Dec-05 5:58
protectorHeath Stewart16-Dec-05 5:58 
You could use ildasm.exe from the .NET Framework SDK to disassemble the assembly to IL and search for "box" and "unbox". But if you're aim is to determine how ths impacts performance you should use a code profiler. There are many already available for the .NET Framework - both free and commercial - and they aren't too terribly difficult to write if you'd rather do that.

The CLR Profiler for the .NET Framework 2.0[^] is one developed at Microsoft and is used in a lot of MSDN articles as wellas in blogs like Rico Mariani's[^], who's responsible for performance in the Developer Division. Not only will it help you determine where boxing is performed but also how often and how much impact is has on your application's performance.

Also remember that any time you treat a number, struct, or enumeration as a reference type (anything that derives from System.ValueType) boxing will occur. This is one of many great reasons for generics (similar to C++ templates) in the .NET Framework, so that you can avoid boxing like so:
// Boxing
ArrayList list = new ArrayList();
list.Add(1);
list.Add(2);
list.Add(3);
 
// No boxing
List<int> list = new List<int>();
list.Add(1);
list.Add(2);
list.Add(3);


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
Questionfree C# 2005 ebook Pin
mehrdadc4815-Dec-05 22:23
mehrdadc4815-Dec-05 22:23 
AnswerRe: free C# 2005 ebook Pin
leppie15-Dec-05 22:37
leppie15-Dec-05 22:37 
GeneralRe: free C# 2005 ebook Pin
HakunaMatada15-Dec-05 23:34
HakunaMatada15-Dec-05 23:34 
AnswerRe: free C# 2005 ebook Pin
albCode16-Dec-05 4:34
albCode16-Dec-05 4:34 
AnswerRe: free C# 2005 ebook Pin
Gulfraz Khan16-Dec-05 6:00
Gulfraz Khan16-Dec-05 6:00 
Answer[Message Removed] Pin
hankjmatt13-Oct-08 21:18
hankjmatt13-Oct-08 21:18 
QuestionURGENT DATAGRID TAB KEY PROBLEM Pin
Greeky15-Dec-05 21:56
Greeky15-Dec-05 21:56 
QuestionAsynchronous call Pin
fmardani15-Dec-05 21:52
fmardani15-Dec-05 21:52 
AnswerRe: Asynchronous call Pin
leppie15-Dec-05 22:41
leppie15-Dec-05 22:41 
GeneralRe: Asynchronous call Pin
fmardani15-Dec-05 22:46
fmardani15-Dec-05 22:46 
QuestionWrite an xml node in a specific position Pin
hellamasta15-Dec-05 21:32
hellamasta15-Dec-05 21:32 
AnswerRe: Write an xml node in a specific position Pin
Heath Stewart15-Dec-05 21:49
protectorHeath Stewart15-Dec-05 21:49 
GeneralRe: Write an xml node in a specific position Pin
hellamasta15-Dec-05 22:17
hellamasta15-Dec-05 22:17 
GeneralRe: Write an xml node in a specific position Pin
Heath Stewart16-Dec-05 5:49
protectorHeath Stewart16-Dec-05 5:49 
GeneralRe: Write an xml node in a specific position Pin
hellamasta16-Dec-05 0:03
hellamasta16-Dec-05 0:03 
GeneralRe: Write an xml node in a specific position Pin
hellamasta16-Dec-05 0:05
hellamasta16-Dec-05 0:05 
GeneralRe: Write an xml node in a specific position Pin
Heath Stewart16-Dec-05 5:49
protectorHeath Stewart16-Dec-05 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.