One of the points to using application variables is the
fact that they are persistent. The entire scope is a
shared memory scope which means that your variables persist
which means you dont have to continually set them every
time.

Request scope does not persist beyond one template call..

So the difference in performance is, setting variables
you need each time, or simply reading variables back
out of a scope that persists.

Of course that is in ideal world..

In the real world ColdFusion doesnt handle its persistent
variables so well. There is the factor of locking and
many things that should not be visible to the developer
(in a language like CF... which are). Thus it becomes
a bit easier to deal with if you dont have to worry
locking. The tradeoff is you are dealing with a
non persistent scope, so request scope is easier
but implemented properly application scope should
and CAN be much faster... And typically if you are
doing more reading than writing this is still
true, it is just cumbersome to lock everything.

Jeremy Allen
elliptIQ Inc.

>-----Original Message-----
>From: Greg Wolfinger [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 02, 2001 4:21 PM
>To: CF-Talk
>Subject: Re: Request VS Application scope
>
>
>> So it appears your choice is to properly lock access to shared variables
>and take the slight performance hit
>> using either automatic locking or manual locking, or do not properly lock
>access to shared variables and have
>> an unstable server
>
>If I understand your response correctly (which I may not have), here is my
>reply:
>
>I wasn't saying that you shouldn't properly lock you application variables.
>You always should lock those variables.  However, with the request
>scope you
>do not have to lock your variables therefore you gain performance using the
>request scope.  Of course setting your constants for every user with the
>request scope also degrades some performance, but I think that the tradeoff
>makes it worth using the Reqeust scope.
>
>--Greg
>----- Original Message -----
>From: "Peter Theobald" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Tuesday, January 02, 2001 3:38 PM
>Subject: Re: Request VS Application scope
>
>
>> But as a recent thread discussed, proper coding requires that you should
>always lock every access to an Application variable, in which case
>automatic
>read locking on Application scope variables does not degrade
>performance any
>more than manual read locking of every read of an Application scope
>variable. So it appears your choice is to properly lock access to shared
>variables and take the slight performance hit using either
>automatic locking
>or manual locking, or do not properly lock access to shared variables and
>have an unstable server.
>>
>> Richard Kern wrote:
>> [...]Summary of lock testing on CF Server
>> [...]First the method of locking whether on the server or actual
>page does
>not
>> significantly affect the application performance.[...]
>>
>>
>> At 03:38 PM 1/2/01 -0500, Greg Wolfinger wrote:
>> >To my understanding using automatic read locking degrades the
>performance
>of
>> >a server greatly.  Also, any performance degrade with using the Request
>> >scope won't make too much of a noticable difference.  This is only my
>> >understanding, but I'm not positive.  So as far as I am
>concerned the use
>of
>> >the Request scope is the way to go.
>> >
>> >--Greg
>> >----- Original Message -----
>> >From: "Bryan Love" <[EMAIL PROTECTED]>
>> >To: "CF-Talk" <[EMAIL PROTECTED]>
>> >Sent: Tuesday, January 02, 2001 2:43 PM
>> >Subject: Request VS Application scope
>> >
>> >
>> >> Here's an interesting question:
>> >>
>> >> We all know that setting global variables in the request scope is
>faster
>> >and
>> >> more thread-safe than using the Application scope, but does
>that remain
>> >true
>> >> as we scale?
>> >>
>> >>
>> >> Environment: 50 request variables are set in application.cfm (so they
>are
>> >> set every time a page is called) OR
>> >>    50 application variables are set one time.
>> >>
>> >> Scenario 1:
>> >> One person hits the site.  One of the following happens depending on
>> >> how you've written the application:
>> >> a. 50 request variables are set and five are read
>> >> b. 5 application variables are read
>> >>
>> >> Scenario 2:
>> >> 5,000 people hit the site at once (i.e. Amazon opens sale of PS2 to
>> >> public). One of the following happens:
>> >> a. 250,000 request variables are set and 25,000 are read
>> >> b. 25,000 application variables are read with automatic read
>> >> locking set to ON in the CF admin
>> >>
>> >>
>> >> I would very much like to hear some feedback on this if
>anyone wants to
>> >> hypothesize about the results.
>> >>
>> >> Bryan Love ACP
>> >> [EMAIL PROTECTED]
>> >>
>> >>
>> >>
>> >
>>
>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to