Click here to Skip to main content
12,627,681 members (31,562 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

8.3K views
Posted

Fast Expression Evaluation

, 25 Feb 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Use Expression += Value instead of Expression = Expression + Value. Since Expression can be arbitrarily complex, this can result in lots of unnecessary work. This forces the JIT to evaluate both copies of Expression, and many times this is not needed. The first statement can be optimized far...
Use Expression += Value instead of Expression = Expression + Value.
Since Expression can be arbitrarily complex, this can result in lots of unnecessary work. This forces the JIT to evaluate both copies of Expression, and many times this is not needed. The first statement can be optimized far better than the second, since the JIT can avoid evaluating the Expression twice.

N.B: Expression it self is a Variable not "Expression"..

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Palash Biswas
Software Developer Kovair Inc.
India India
I have started programming in 10 years on Fortran 77.Then it was Cobol,C,C++,JAVA 1.2, ASP,JavaScript. Now it at all C# and .NET Framework, such tehnologies as WCF, ADO.NET, ASP.NET, LINQ, ASP.NET Ajax , FLEX and another.

You may also be interested in...

Pro

Comments and Discussions

 
QuestionExpression = Expression + Value??? Pin
Rozis24-Feb-10 11:47
memberRozis24-Feb-10 11:47 
AnswerRe: Expression = Expression + Value??? [modified] Pin
Palash Biswas25-Feb-10 4:34
memberPalash Biswas25-Feb-10 4:34 
AnswerRe: Expression = Expression + Value??? Pin
dwilliss25-Feb-10 16:51
memberdwilliss25-Feb-10 16:51 
GeneralRe: Expression = Expression + Value??? Pin
Palash Biswas25-Feb-10 18:10
memberPalash Biswas25-Feb-10 18:10 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161205.3 | Last Updated 25 Feb 2010
Article Copyright 2010 by Palash Biswas
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid