Click here to Skip to main content
15,917,177 members
Home / Discussions / C#
   

C#

 
AnswerRe: string resizing Pin
Rick Shaub12-Jan-10 8:03
Rick Shaub12-Jan-10 8:03 
AnswerRe: string resizing Pin
carlecomm12-Jan-10 16:45
carlecomm12-Jan-10 16:45 
QuestionDeployment Project Pin
CT0013812-Jan-10 1:20
CT0013812-Jan-10 1:20 
Questiondelay in process Pin
sachees12312-Jan-10 1:11
sachees12312-Jan-10 1:11 
AnswerRe: delay in process Pin
Luc Pattyn12-Jan-10 1:56
sitebuilderLuc Pattyn12-Jan-10 1:56 
Questionwhich one will be faster? Pin
Joe Rozario12-Jan-10 0:29
Joe Rozario12-Jan-10 0:29 
AnswerRe: which one will be faster? PinPopular
Paulo Zemek12-Jan-10 0:37
Paulo Zemek12-Jan-10 0:37 
AnswerRe: which one will be faster? Pin
harold aptroot12-Jan-10 0:57
harold aptroot12-Jan-10 0:57 
Short answer: test it

I took a little look with the Reflector and I'm willing to hazard a guess: the first one. Because: the first one just calls Number.Format(something) which is an extern function, the second one calls int.ToString(some stuff) so basically it just adds a method call (which could be inlined by the JIT engine) and the last one also does some string appending, to which JIT magic may also happen, it might have an "if (first.Length == 0) return Second" and then the optimizer in the JIT compiler might decide that since the string is a constant, its Length is also constant, and then it might optimize that test away and skip the string appending completely.
That is very optimistic.

So, still test it..

Who knows, maybe it's even possible to write a faster IntToString method? I would look into it. Especially if a lot is known about the input (probability distribution etc). I wouldn't count on it, but you don't know until you try..
AnswerRe: which one will be faster? Pin
Dan Mos12-Jan-10 7:52
Dan Mos12-Jan-10 7:52 
Questionmy application on windows taskbar Pin
Jassim Rahma11-Jan-10 23:12
Jassim Rahma11-Jan-10 23:12 
AnswerRe: my application on windows taskbar Pin
Eddy Vluggen12-Jan-10 0:31
professionalEddy Vluggen12-Jan-10 0:31 
AnswerRe: my application on windows taskbar Pin
Dave Kreskowiak12-Jan-10 4:17
mveDave Kreskowiak12-Jan-10 4:17 
QuestionDelete Row is Not Update with dataadapter.update command Pin
tojitendrapatel11-Jan-10 22:44
tojitendrapatel11-Jan-10 22:44 
AnswerRe: Delete Row is Not Update with dataadapter.update command Pin
Abhinav S11-Jan-10 23:08
Abhinav S11-Jan-10 23:08 
QuestionInstaller logo Pin
Priya Prk11-Jan-10 22:37
Priya Prk11-Jan-10 22:37 
AnswerRe: Installer logo Pin
The Man from U.N.C.L.E.11-Jan-10 23:03
The Man from U.N.C.L.E.11-Jan-10 23:03 
GeneralRe: Installer logo Pin
Alex Manolescu11-Jan-10 23:26
Alex Manolescu11-Jan-10 23:26 
GeneralRe: Installer logo Pin
The Man from U.N.C.L.E.12-Jan-10 1:17
The Man from U.N.C.L.E.12-Jan-10 1:17 
GeneralRe: Installer logo Pin
Mirko198012-Jan-10 1:54
Mirko198012-Jan-10 1:54 
GeneralRe: Installer logo [modified] Pin
Priya Prk12-Jan-10 1:38
Priya Prk12-Jan-10 1:38 
QuestionHow to test a webapp (c#) where is the executable for "gui runner" Pin
gerrybrennan11-Jan-10 22:23
gerrybrennan11-Jan-10 22:23 
QuestionHow to convert a Control into a ToolStripButton Pin
ArjenGroeneveld11-Jan-10 22:07
ArjenGroeneveld11-Jan-10 22:07 
AnswerRe: How to convert a Control into a ToolStripButton Pin
Martin#11-Jan-10 23:47
Martin#11-Jan-10 23:47 
GeneralRe: How to convert a Control into a ToolStripButton Pin
ArjenGroeneveld12-Jan-10 21:02
ArjenGroeneveld12-Jan-10 21:02 
GeneralRe: How to convert a Control into a ToolStripButton Pin
Martin#12-Jan-10 21:51
Martin#12-Jan-10 21:51 

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.