Click here to Skip to main content
15,914,222 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to call managed function from remote device? Pin
spif20019-Jan-06 2:44
spif20019-Jan-06 2:44 
QuestionRetrieve hidden column Pin
PaulaM9-Jan-06 1:50
PaulaM9-Jan-06 1:50 
AnswerRe: Retrieve hidden column Pin
Robert Rohde9-Jan-06 3:04
Robert Rohde9-Jan-06 3:04 
QuestionWeb User Control Pin
karthik_dotnet19-Jan-06 1:46
karthik_dotnet19-Jan-06 1:46 
AnswerRe: Web User Control Pin
PrakashBhaskar12-Jan-06 18:49
PrakashBhaskar12-Jan-06 18:49 
QuestionWSE 2.0 Exception Pin
jdkulkarni9-Jan-06 1:23
jdkulkarni9-Jan-06 1:23 
QuestionTransparent image box Pin
ugurbil9-Jan-06 0:14
ugurbil9-Jan-06 0:14 
QuestionC# Performance Pin
MrEyes9-Jan-06 0:04
MrEyes9-Jan-06 0:04 
Out of sheer curiosity I have a quick question relating to C# performance. I have the two following methods:

public static string VerboseProgrammingMethod()
{
 System.Guid g = Guid.NewGuid();
 string s = g.ToString();
 string f = s.Substring(0,4);

 return f; 
}


public static string OneLineProgrammingMethod()
{
 return Guid.NewGuid().ToString().Substring(0, 4);
}


As you can see both of them will generate exactly the same output as they essentially perform the same functions. The question is is one of them quicker/less memory intensive than the other?

I am under the impression that it doesnt make any difference whatsoever, but I would be grateful if somebody could confirm this
AnswerRe: C# Performance Pin
J4amieC9-Jan-06 0:09
J4amieC9-Jan-06 0:09 
AnswerRe: C# Performance Pin
krieg389-Jan-06 0:22
krieg389-Jan-06 0:22 
GeneralRe: C# Performance Pin
mav.northwind9-Jan-06 0:28
mav.northwind9-Jan-06 0:28 
AnswerRe: C# Performance Pin
Guffa9-Jan-06 4:13
Guffa9-Jan-06 4:13 
AnswerRe: C# Performance Pin
leppie9-Jan-06 0:54
leppie9-Jan-06 0:54 
GeneralRe: C# Performance Pin
MrEyes9-Jan-06 1:01
MrEyes9-Jan-06 1:01 
GeneralRe: C# Performance Pin
Colin Angus Mackay9-Jan-06 1:19
Colin Angus Mackay9-Jan-06 1:19 
GeneralRe: C# Performance Pin
MrEyes9-Jan-06 1:31
MrEyes9-Jan-06 1:31 
GeneralRe: C# Performance Pin
Mike Dimmick9-Jan-06 3:57
Mike Dimmick9-Jan-06 3:57 
GeneralRe: C# Performance Pin
MrEyes9-Jan-06 4:12
MrEyes9-Jan-06 4:12 
GeneralRe: C# Performance Pin
Guffa9-Jan-06 4:52
Guffa9-Jan-06 4:52 
GeneralRe: C# Performance Pin
User 66589-Jan-06 4:10
User 66589-Jan-06 4:10 
GeneralRe: C# Performance Pin
Dave Kreskowiak9-Jan-06 5:43
mveDave Kreskowiak9-Jan-06 5:43 
QuestionInvoking GUI Pin
rnvrnv8-Jan-06 22:48
rnvrnv8-Jan-06 22:48 
AnswerRe: Invoking GUI Pin
ika28-Jan-06 22:57
ika28-Jan-06 22:57 
AnswerRe: Invoking GUI Pin
krieg388-Jan-06 23:00
krieg388-Jan-06 23:00 
GeneralRe: Invoking GUI Pin
rnvrnv8-Jan-06 23:05
rnvrnv8-Jan-06 23:05 

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.