> To expand on Dave's statement the times you would want Client variables
> over
> memory (session) variables for storage is when the application needs to
> operate in a cluster of web servers.  Sharing memory (session) variables
> then become impracticable.

Session state stored in client variables also survive service and server
restarts.

> Even though he actually did, it just goes without saying: memory is faster
> than I/O.

Under a heavy load, this is no doubt true. However, I was recently surprised
to find that under a small to moderate load, there may be no noticeable
performance difference.

I was recently tasked with upgrading a site from ColdFusion 5 to MX. I had
used client variables when originally designing the site for various
reasons. Mostly, I was trying to avoid locking issues and anticipating the
need for clustering.

Suffice it to say, we never had to cluster the site and locking for
stability's sake is no longer necessary. So, when performing the upgrade, I
decided to test the performance difference between using session variables
and client variables.

It took me a couple of hours to update the code base (20,000 lines of code).
I was surprised to find that, under a minimal to moderate load, I could not
measure the performance difference using the tools I had. Consequently, I
decided not to make the switch (don't fix what ain't broke).

That said, for new sites, I generally use the session scope because I can
store complex objects such as CFCs in the session scope. Additionally, since
the session scope is now thread safe, I don't have to worry about whether or
not every developer is properly locking their code.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188971
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to