it demonstrates a lack of understanding of the features of the language”

 

I don’t like this point (and I’m really not trying to single out Brian at all – this is just the point where I felt like chiming into the conversation).  Yes evaluate() is slow, but because someone uses “feature A” instead of “feature B” of a language, I disagree that it always is because of a lack of understanding of features. 

 

I’ve written apps in the past, and in keeping with the “make it work now, make it fast later” ideals (which sometimes have to be followed, depending on your work environment and schedule…Doug are you out there? Back me up here! :) ), I will write code in the first way I can think of that gets the job done.  Sometimes things are out of my control, and I _have_ to wait for version 2 before I can go in and remove calls to evaluate(), and other poorly/quickly written sections of code.   And if I’m writing a library that I need to get _working_ now, I know there are spots that I’ve used evaluate() to get something done. 

 

Everything has it’s place…

 

 

.02

-nolan

 

 

 

Nolan Erck
Web Developer/Programmer
Schools Financial Credit Union
(916) 569-5409 Office
(916) 569-2024 Fax
www.schools.org

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Kotek
Sent: Thursday, May 18, 2006 11:14 AM
To: [email protected]
Subject: Re: [CFCDev] CFINVOKE vs. Evaluate

 

The point is that in virtually all cases:

1. evaluate() is slower
2. there is no reason to use it
3. it is more difficult to read and understand
4. it demonstrates a lack of understanding of the features of the language

On 5/18/06, Roland Collins <[EMAIL PROTECTED]> wrote:

Resent without the "SPAM" flags ;)

 

I've actually posted metrics on this before – and you're pretty much right.  The performance penalties of using evaluate are trivial at best, and often times non-existent.  The metrics below demonstrate that, given server conditions, the evaluate code can even perform faster than inline code  Anyway, it's *very* clear from the results that the overhead of evaluate is largely over-hyped.  Also, attached are the two test files I used to generate the metrics.

 

Simple _expression_ - 10,000 Iterations

 

Inline

Evaluate

Run 1

32

62

Run 2

31

78

Run 3

16

62

Run 4

31

79

Run 5

31

63

Average

28.2

68.8

 

 

 

Simple _expression_ - 100,000 Iterations

 

Inline

Evaluate

Run 1

328

437

Run 2

312

828

Run 3

297

485

Run 4

313

828

Run 5

312

578

Average

312.4

631.2

 

 

 

Object Invocation - 1000 Iterations

 

Inline

Evaluate

Run 1

1830

2190

Run 2

1328

1391

Run 3

1437

1078

Run 4

1313

1843

Run 5

1843

1688

Average

1550.2

1638

 

 

 

Object Invocation - 10000 Iterations

 

Inline

Evaluate

Run 1

14375

11672

Run 2

14250

20187

Run 3

17140

20828

Run 4

18328

11735

Run 5

20453

20125

Average

16909.2

16909.4

 

Roland

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Brian Rinaldi
Sent: Thursday, May 18, 2006 11:05 AM
To: [email protected]
Subject: SPAM: Re: [CFCDev] CFINVOKE vs. Evaluate

 

I only recently started watching this thread, but this seems to me that the "avoid evaluate()" rule generally doesn't have much documented justification (though I am not arguing that it isn't valid - just that I have rarely seen much documentation on the differences - if I missed some earlier in this thread I apologize in advance). The ColdFusion MX Coding Guidlines only says the following under Performance "Don'ts":

"Don't use evaluate() - Avoid evaluate() unless there is no other way to write your code (and there is almost always another way to write your code)."

A Google search only comes up with the following posts (the first being recent and the second a couple years old):

http://cfprimer.blogspot.com/2005/03/avoid-evaluate.html
http://www.sitepoint.com/blogs/2004/02/19/running-performance-metrics-on-coldfusion-functions-and-operators/

An MXNA search comes up with some more recent posts:

http://www.succor.co.uk/index.cfm/2006/4/13/Avoid-evaluate-always
http://www.blogoffusion.com/index.cfm/2006/4/18/Structure-style-evaluation-rocks

However, nobody seems to offer specific metrics (except for one that came to the conclusion that the differences were minimal). Let me be clear, I am not arguing that this isn't a completely valid best practice - I am sure at some point it was based upon some documented metrics, but it would be nice to see them.

- Brian Rinaldi
blog: http://www.remotesynthesis.com/blog
ColdFusion Open Source List: http://www.remotesynthesis.com/cfopensourcelist
Boston CFUG - http://www.bostoncfug.org


From: "Nick Tong - TalkWebSolutions.co.uk" < [EMAIL PROTECTED]>
Sent:
Thursday, May 18, 2006 10:49 AM
To: [email protected]
Subject: Re: [CFCDev] CFINVOKE vs. Evaluate


On 18/05/06, Peter Bell wrote:
> So, would cf invoke actually be any faster?

I think this can depend on if you have initiated the object into memory i.e.


in this case then i believe it is faster

--
Nick Tong

web: http://talkwebsolutions.co.uk
blog: http://succor.co.uk
shorturls: http://wapurl.co.uk


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

The information contained in this e-mail is confidential and may contain privileged information exempt from disclosure under applicable law. The information is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, employee, or agent responsible to deliver it to the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please delete the message from your computer and immediately notify the sender by telephone (you may call collect) at 916-569-5400 or by e-mail to [EMAIL PROTECTED] Thank you. ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to