Click here to Skip to main content
15,900,108 members
Home / Discussions / C#
   

C#

 
GeneralRe: Computer Info Pin
hxxbin11-Feb-04 4:21
hxxbin11-Feb-04 4:21 
GeneralRe: Computer Info Pin
Kenneth Childs11-Feb-04 5:01
Kenneth Childs11-Feb-04 5:01 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:38
protectorHeath Stewart11-Feb-04 9:38 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:51
protectorHeath Stewart11-Feb-04 9:51 
GeneralRe: Computer Info Pin
Daniel Turini11-Feb-04 4:33
Daniel Turini11-Feb-04 4:33 
Generalcreating and editing Resource files Pin
POKRI11-Feb-04 3:57
POKRI11-Feb-04 3:57 
GeneralRe: creating and editing Resource files Pin
OmegaSupreme11-Feb-04 9:29
OmegaSupreme11-Feb-04 9:29 
GeneralRe: creating and editing Resource files Pin
Heath Stewart11-Feb-04 9:34
protectorHeath Stewart11-Feb-04 9:34 
GeneralPDF Viewer Pin
Mahesh Varma11-Feb-04 2:34
Mahesh Varma11-Feb-04 2:34 
GeneralRe: PDF Viewer Pin
Heath Stewart11-Feb-04 2:53
protectorHeath Stewart11-Feb-04 2:53 
GeneralTable Names Of a MS Access Database Pin
Daminda11-Feb-04 1:06
Daminda11-Feb-04 1:06 
GeneralRe: Table Names Of a MS Access Database Pin
Heath Stewart11-Feb-04 3:04
protectorHeath Stewart11-Feb-04 3:04 
GeneralRe: Table Names Of a MS Access Database Pin
Spanky311-Feb-04 8:18
Spanky311-Feb-04 8:18 
GeneralWe are inviting you to hotdotnet. Pin
Anonymous11-Feb-04 0:19
Anonymous11-Feb-04 0:19 
GeneralRe: We are inviting you to hotdotnet. Pin
Corinna John11-Feb-04 0:38
Corinna John11-Feb-04 0:38 
GeneralRe: We are inviting you to hotdotnet. Pin
Uwe Keim11-Feb-04 1:43
sitebuilderUwe Keim11-Feb-04 1:43 
GeneralBinding array to combobox Pin
Anonymous10-Feb-04 20:05
Anonymous10-Feb-04 20:05 
QuestionPanel Control covering my other controls... IDE BUG? Pin
gordingin10-Feb-04 16:15
gordingin10-Feb-04 16:15 
AnswerRe: Panel Control covering my other controls... IDE BUG? Pin
Heath Stewart11-Feb-04 3:14
protectorHeath Stewart11-Feb-04 3:14 
GeneralC# communication with events Pin
MusicAlly10-Feb-04 14:45
MusicAlly10-Feb-04 14:45 
GeneralRe: C# communication with events Pin
Kentamanos10-Feb-04 15:35
Kentamanos10-Feb-04 15:35 
GeneralRe: C# communication with events Pin
MusicAlly10-Feb-04 16:54
MusicAlly10-Feb-04 16:54 
GeneralRe: C# communication with events Pin
Heath Stewart11-Feb-04 3:52
protectorHeath Stewart11-Feb-04 3:52 
GeneralCompiler Optimizations Pin
Andrew Shapira10-Feb-04 13:44
Andrew Shapira10-Feb-04 13:44 
Where is a discussion of the current and future optimizations that the C# compilers do? When I see things like the following I start to question my faith in csc being good at optimizing. (The same kind of thing shows up in cordbg when looking at the JIT code for a similar example.)

% cat y.cs

using System;

class A {
bool On { get { return true; } }
public void Print() {
if (On) {
Console.WriteLine("On");
}
}
}

class ConditionalTest {

static void Main()
{
A a = new A();
a.Print();
}
}

% csc /optimize+ y.cs

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

% ildasm y.exe

.method public hidebysig instance void Print() cil managed
{
// Code size 19 (0x13)
.maxstack 2
IL_0000: ldarg.0
IL_0001: call instance bool A::get_On()
IL_0006: brfalse.s IL_0012
IL_0008: ldstr "On"
IL_000d: call void [mscorlib]System.Console::WriteLine(string)
IL_0012: ret
} // end of method A::Print

%

At least the compiler eliminates the "if" test when "On" is replaced with "true" in the test.


GeneralVS-style colors Pin
Judah Gabriel Himango10-Feb-04 10:30
sponsorJudah Gabriel Himango10-Feb-04 10:30 

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.