RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-06 Thread Andre Turrettini
agreed. I'm praying that a major improvment in the next cf will be that all
(or as many as possible) tags and functions are available within cfscript.

-Original Message-
From: Howard Fore [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 06, 2004 6:14 AM
To: CF-Talk
Subject: Re: Script vs Tags (was Re: ColdFusion Coding Contest)

If you can do everything you need in cfscript, it's much more readable 
IMHO. However the functionality gap between cfscript and cf tags 
negates this to some degreee. In my experience switching back and forth 
between tags and cfscript has yielded some very awkward code. I've 
almost completely stopped using cfscript altogether, simply because of 
the time I lose trying to maintain a logical block of code in one 
paradigm or the other. As always your mileage may vary, products may 
settle during shipping, and objects may be closer than they appear.

--
Howard Fore, [EMAIL PROTECTED]

On Apr 5, 2004, at 8:40 PM, Philip Arnold wrote:

> There is the one advantage to CFSCRIPT over tags
>
> Readability
>
> If you can read Script easier than reading tag based code, then use
> Script 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-06 Thread Dave Watts
> Just a note on this: the bug is basically that you never see 
> value of 1-9 - only 0, 10 or more than 10. (and I think it's 
> actually an OS problem on Windows, not a CF issue - can any 
> Linux/Unix user confirm the bug on their platform?)

According to the MM guy who explained this problem to me, the underlying
reason for this is that CF simply isn't capable of accurately dealing with
time increments smaller than 10 milliseconds. Of course, this was a while
ago - back in the CF 3 and 4 days - so things may have changed since then.

I've observed the same behavior on Solaris with CF 4 and 5, if I recall
correctly.

> This is exactly the reason that you do may operations in a 
> loop when testing this stuff - you need to get things out of 
> that initial 10ms "gray area". Basically any timings higher 
> than 10 ms are "trustworthy" since it's not the individual 
> operations being timed but the interval between the reports.

The problem with this approach is that it only tells you what will happen if
a single request repeats the operation within a loop. There have been
several cases I've observed in which this isn't reflected at all when the
test involves multiple requests repeating the operation in parallel.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-06 Thread Pete Ruckelshaus - CFList
I agree completely on the readability issue.  In my application.cfm 
file, I try to use cfscript blocks as much as possible, mainly to keep 
code both compact and readable.  I do the same thing on pages where I 
need to set more than one or two variables.  cfscript blocks are also 
easier to find when color-coded by CF Studio.

Just my $.02, don't look a gift horse in the mouth, and never trust a 
bald barber.

Pete

Howard Fore wrote:
> If you can do everything you need in cfscript, it's much more readable
> IMHO. However the functionality gap between cfscript and cf tags
> negates this to some degreee. In my experience switching back and forth
> between tags and cfscript has yielded some very awkward code. I've
> almost completely stopped using cfscript altogether, simply because of
> the time I lose trying to maintain a logical block of code in one
> paradigm or the other. As always your mileage may vary, products may
> settle during shipping, and objects may be closer than they appear.
> 
> --
> Howard Fore, [EMAIL PROTECTED]
> 
> On Apr 5, 2004, at 8:40 PM, Philip Arnold wrote:
> 
>  > There is the one advantage to CFSCRIPT over tags
>  >
>  > Readability
>  >
>  > If you can read Script easier than reading tag based code, then use
>  > Script
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-06 Thread C. Hatton Humphrey
> If you can do everything you need in cfscript, it's much more readable
> IMHO. However the functionality gap between cfscript and cf tags
> negates this to some degreee. In my experience switching back and forth
> between tags and cfscript has yielded some very awkward code. I've
> almost completely stopped using cfscript altogether, simply because of
> the time I lose trying to maintain a logical block of code in one
> paradigm or the other. As always your mileage may vary, products may
> settle during shipping, and objects may be closer than they appear.

I've seen this as well; however in my foray into UDF's I have found that
there is a to build custom functions to "mimic" CF code by handing the
"switch" off to the UDF and then calling it from within a script block.

True, it might be considered reinventing the wheel but it also allows a
continuity of coding and takes advantage of the CFScript improvements.  That
would be the theory, at least.  I have not had a chance to put this to the
test.

Hatton

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.642 / Virus Database: 410 - Release Date: 3/24/2004
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-06 Thread Howard Fore
If you can do everything you need in cfscript, it's much more readable 
IMHO. However the functionality gap between cfscript and cf tags 
negates this to some degreee. In my experience switching back and forth 
between tags and cfscript has yielded some very awkward code. I've 
almost completely stopped using cfscript altogether, simply because of 
the time I lose trying to maintain a logical block of code in one 
paradigm or the other. As always your mileage may vary, products may 
settle during shipping, and objects may be closer than they appear.

--
Howard Fore, [EMAIL PROTECTED]

On Apr 5, 2004, at 8:40 PM, Philip Arnold wrote:

> There is the one advantage to CFSCRIPT over tags
>
> Readability
>
> If you can read Script easier than reading tag based code, then use
> Script
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-05 Thread Philip Arnold
> From: Michael Dinowitz
> 
> That's very strange. While I did find some big differences in 
> CFSCRIPT vs. CFTAGS in earlier versions of CF, I have not 
> seen such in CFMX. I'm going to rerun my tests in the latest 
> version to see how they run and also look at the class files. 
> A perfect example of a change is that CFIF vs. IIF() in CF5 
> showed CFIF to be much faster. In CFMX, they both compiled 
> down to the same Java code and there was no speed difference.

There is the one advantage to CFSCRIPT over tags

Readability

If you can read Script easier than reading tag based code, then use
Script

Simple, isn't it? 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-05 Thread Jim Davis
Third, you're pointing out an approximate difference of three milliseconds
per request, which is practically immeasurable by CF (if I recall correctly,
CF can't accurately handle time increments smaller than 10 milliseconds). I
would question whether that's a significant performance increase, especially
given the second point above.


Just a note on this: the bug is basically that you never see value of 1-9 -
only 0, 10 or more than 10.  (and I think it's actually an OS problem on
Windows, not a CF issue - can any Linux/Unix user confirm the bug on their
platform?)

After the 10 ms threshold is reached timings are accurate.

This is exactly the reason that you do may operations in a loop when testing
this stuff - you need to get things out of that initial 10ms "gray area".
Basically any timings higher than 10 ms are "trustworthy" since it's not the
individual operations being timed but the interval between the reports.

All that being said I agree completely that 3 ms in an artificial test is
nothing to base a conclusion on - you'll never see a practical ramification
of the difference.

Jim Davis
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-05 Thread Dave Watts
> > It's been my experience that using CFSCRIPT never provided 
> > any significant performance increase in any case.
> 
> I disagree.
> 
> My tests:
> 
> the function queryRandomize() from DRK 4 (or was it 5?), I 
> rewrote it, line-by-line (including comments!) and called it 
> queryRandomizeCFML().
> 
> 100,000 iterations of each try, randomizing a 1 column query 
> with 20 rows, time in ms, server is CFMX 6.1 standalone 
> developer, 3 tries:
> 
> script  tags
> 14640   26342
> 14718   25983
> 14609   26108

I submit that your test provides insufficient data to justify that
conclusion.

First, running a single algorithm serially within a loop doesn't provide an
especially useful measurement of how that algorithm will work when executed
in parallel. I've seen all sorts of things that seem faster when measured
within a loop, but don't seem faster when measured by load testing - I've
even seen things that are slower when measured by load testing, even though
they were faster within a loop!

Second, you'd need to test more than one algorithm to contradict the general
statement about CFSCRIPT not providing any significant performance increase.
It may run faster when manipulating a query object, for example, but may be
slower for everything else.

Third, you're pointing out an approximate difference of three milliseconds
per request, which is practically immeasurable by CF (if I recall correctly,
CF can't accurately handle time increments smaller than 10 milliseconds). I
would question whether that's a significant performance increase, especially
given the second point above.

Finally, as with all these "which is faster" questions that come up, even if
you are correct in your supposition, the time savings you may get by doing
this is typically dwarfed by that gained by additional caching. I don't
think I've ever seen an application which has taken full advantage of every
caching opportunity. So, the question becomes whether you want to spend your
time optimizing your code based on your conception of what is faster within
a given version of CF, or whether you want to spend your time making your
application faster no matter what version of CF you use.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-05 Thread Michael Dinowitz
That's very strange. While I did find some big differences in CFSCRIPT vs.
CFTAGS in earlier versions of CF, I have not seen such in CFMX. I'm going to
rerun my tests in the latest version to see how they run and also look at the
class files.
A perfect example of a change is that CFIF vs. IIF() in CF5 showed CFIF to be
much faster. In CFMX, they both compiled down to the same Java code and there
was no speed difference.

> > It's been my experience that using CFSCRIPT never provided any significant
> > performance increase in any case.
> >
>
> I disagree.
>
> My tests:
>
> the function queryRandomize() from DRK 4 (or was it 5?), I rewrote it,
> line-by-line (including comments!) and called it queryRandomizeCFML().
>
> 100,000 iterations of each try, randomizing a 1 column query with 20
> rows, time in ms, server is CFMX 6.1 standalone developer, 3 tries:
>
> script  tags
> 14640   26342
> 14718   25983
> 14609   26108
>
>
> -nathan strutz
>
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Script vs Tags (was Re: ColdFusion Coding Contest)

2004-04-05 Thread Nathan Strutz
> It's been my experience that using CFSCRIPT never provided any significant
> performance increase in any case.
> 

I disagree.

My tests:

the function queryRandomize() from DRK 4 (or was it 5?), I rewrote it, 
line-by-line (including comments!) and called it queryRandomizeCFML().

100,000 iterations of each try, randomizing a 1 column query with 20 
rows, time in ms, server is CFMX 6.1 standalone developer, 3 tries:

script  tags
14640   26342
14718   25983
14609   26108

-nathan strutz
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]