> > ...
> > C.  Setup
> > Run date:  21 Dec 00.  CF Server is 4.5.1 on NT server 4.0 SP5.  
> > Two servers involved - local machine and production server on 
> > LAN (light traffic).
> >
> > Single page submitted to server with 1000 iteration loop on 
> > database query. CF page has three session variables and one 
> > database query. Three runs for each approach were done and 
> > recorded.
> > ...
>
> So, if there is no performance difference, it looks like I 
> can conclude:
> Assuming you have administrative control over the server 
> where your site will run, you should always use (at least) 
> automatic read locking instead of manual read locking. It is 
> less code, cleaner to read, less to parse, less to type, with 
> no performance penalty.

I'd like to point out a couple of potential problems with this test.

The first problem is that looping over a block of code isn't a good analog
to what will happen when that block of code is run singly within multiple
concurrent requests. When you loop over a block of code in a single request,
you're seeing how long it takes one thread to process the same data over and
over again. That's not what happens in real life - especially when you're
talking about testing the efficacy of locking methods.

The second problem is that, arguably, if there is any measurable performance
difference, there will be some point at which both methods perform the same.
For example, it might very well be the case that with four or less
individual variables within a single CFLOCK, automatic read locking performs
better, but with more variables, a single lock within the code performs
better. A more meaningful test would require that multiple tests be
performed with different numbers of variables to be locked.

My overall point here is that testing isn't as easy as it might sound, and
you should carefully examine test methodologies before simply accepting the
results.

> Of course, writes should still be locked. And you can still 
> implement manual locks for any exceptional cases even with 
> auto locking turned on.

What happens if you use manual locks for these exceptional cases? Which
takes precedence, the automatic locking or the manual locking? I certainly
don't know.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

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

Reply via email to