That just made ugly code, uglier --

I cast all the loop variables as long & got the generated code below  
(which ran slower)

-- reminds me of an experience I had when I worked for IBM and was  
trying to get a software product out early, by getting pre-approval  at  
all the phases during the development cycle.

-- the result was that "expediting takes a little longer!"

-- so maybe Matt is right -- this is an entrophy -- "optimized code  
runs a little slower!"

Dick

Here's the gen'd code:

                        Z.set(((java.lang.Object)("0")));
                        X.set(this.JavaCast("long",((java.lang.Object)("0"))));
                        Z.set(this.JavaCast("long",((java.lang.Object)("0"))));
                         
this.WriteOutput((coldfusion.runtime.Cast._String(this._autoscalarize(LO 
OPS))).concat(" Loops<br>"));
                        
STIME.set(coldfusion.runtime.Cast._Object(this.GetTickCount()));
                        for  
(X.set(((java.lang.Object)("1")));_compare(this._autoscalarize(X),100000 
0.0)<=0;X.set(coldfusion.runtime.Cast._Object((coldfusion.runtime.Cast._ 
double(this._autoscalarize(X)))+(1.0)))){{
                                         
Z.set(coldfusion.runtime.Cast._Object((coldfusion.runtime.Cast._double(t 
his._autoscalarize(Z)))+(coldfusion.runtime.Cast._double(this._autoscala 
rize(X)))));
                                }
                        }
                        
ETIME.set(coldfusion.runtime.Cast._Object(this.GetTickCount()));



On Wednesday, September 18, 2002, at 07:44 AM, Michael Corbridge wrote:

> Try javacast, which is a new function in cfmx
>
> <cfscript>
> x = 1;
> y = javacast("int",x);
> </cfscript>
>
>
> -----Original Message-----
> From: Matt Liotta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 18, 2002 10:30 AM
> To: CF-Talk
> Subject: RE: Jsp Vs Cfm (CFMX) -- Test Code
>
>
> I doubt anyone outside of Macromedia can answer that.
>
> Matt Liotta
> President & CEO
> Montara Software, Inc.
> http://www.montarasoftware.com/
> 888-408-0900 x901
>
>> -----Original Message-----
>> From: Joe Eugene [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, September 17, 2002 11:41 PM
>> To: CF-Talk
>> Subject: RE: Jsp Vs Cfm (CFMX) -- Test Code
>>
>> Would the below be an easy change in CFMX?
>>
>> <cfset int foobar = 1>
>> or
>> <cfscript>
>>      int foobar = 1;
>> </cfscript>
>>
>> Would declare a coldfusion.runtime.Integer instead of the following.
>>
>> <cfset foobar = 1>
>> or
>> <cfscript>
>>      foobar = 1;
>> </cfscript>
>>
>> Would declare a coldfusion.runtime.Variable.
>>
>> Joe
>>
>>
>>
>>> -----Original Message-----
>>> From: Matt Liotta [mailto:[EMAIL PROTECTED]]
>>> Sent: Wednesday, September 18, 2002 1:12 AM
>>> To: CF-Talk
>>> Subject: RE: FW: Jsp Vs Cfm (CFMX) -- Test Code
>>>
>>>
>>> Well CF could use the same technique that VB did. VB optionally
> allows
>>> variables to be declared as a type. If no type is declared then the
>>> variable is considered of type variant. For example, the following
> could
>>> work with CF.
>>>
>>> <cfset int foobar = 1>
>>> or
>>> <cfscript>
>>>     int foobar = 1;
>>> </cfscript>
>>>
>>> Would declare a coldfusion.runtime.Integer instead of the following.
>>>
>>> <cfset foobar = 1>
>>> or
>>> <cfscript>
>>>     foobar = 1;
>>> </cfscript>
>>>
>>> Would declare a coldfusion.runtime.Variable.
>>>
>>> Matt Liotta
>>> President & CEO
>>> Montara Software, Inc.
>>> http://www.montarasoftware.com/
>>> 888-408-0900 x901
>>>
>>>> -----Original Message-----
>>>> From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
>>>> Sent: Tuesday, September 17, 2002 9:56 PM
>>>> To: CF-Talk
>>>> Subject: Re: FW: Jsp Vs Cfm (CFMX) -- Test Code
>>>>
>>>> On Tuesday, September 17, 2002, at 09:41 , Dick Applebaum wrote:
>>>>> Rather I suggest that CFMX allow us to tell it a variable's type
>>>>> (optionally) so that it can use that to generate efficient code,
>>>>
>>>> That would make ColdFusion quite a different language! :)
>>>>
>>>> Yes, it's certainly one possible approach, allowing the user to
>>> declare
>>>> variables with a type (and extending the CF types to include
> "integer"
>>>> would also be a useful enhancement, instead of just "numeric" and
>>> "binary"
>>>> ).
>>>>
>>>> I actually prefer the code analysis approach since it allows
> CFMX's
>>>> compiler to evolve without requiring users to change their code
> and
>>> could
>>>> substantially speed up certain constructs in legacy code.
>>>>
>>>> "If you're not annoying somebody, you're not really alive."
>>>> -- Margaret Atwood
>>>>
>>>>
>>>
>>
>
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to