Well, as always in these situations I did a quick check as how things are in
the real life. Here is my code:
<cfset mm = GetTickCount()>
<cfloop index="m" from="1" to="10000" step="1">
<cflock timeout="30" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
<cfset session.blob = 123>
</cflock>
</cfloop>
<cfoutput>Scoped: #GetTickCount() - mm#</cfoutput><br>
<cfset ww = GetTickCount()>
<cfloop index="m" from="1" to="10000" step="1">
<cflock timeout="30" throwontimeout="Yes" name="hfjdshfkshfks"
type="EXCLUSIVE">
<cfset session.bleeh = 123>
</cflock>
</cfloop>
<cfoutput>Named: #GetTickCount() - ww#</cfoutput><br>
I didn't see any performance differences. Maybe it is apparent with more
variables used? Incidentally I noticed a lot of people using createUUID()
for the named locks. Wow, performance dies right there.
You can run it yourself from:
http://dev.energyshop.com/tk/mytest.cfm
[Tom Kitta]
I think it might also be a personal preferance.
TK
The rule of thumb is that properly named locks will perform better
than scope locks, however, because you have complete control over the
names, named locks can perform worse than scoped locks if the name
provided is inspecific, i.e.
<cflock scope="session">
will probably perform better than
<cflock name="session">
(assuming the same scheme is used for locking the same events
throughout the application)
on the other hand
<cflock name="#getcurrenttemplatepath()#">
will perform _much_ better than
<cflock scope="session">
s. isaac dealey 214.823.9345
new epoch : isn't it time for a change?
add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

