I'm trying something new out for all my UDFs and I wanted to get a little
feedback if I could...


I just started loading all my UDFs into a structure in the application scope
called UDFs.  So that if I wanted to call GetFileSizeFormat, I would do:


#application.UDFs.GetFileSizeFormat(123456)#


The benefits to this, of course, is that if I have 1 or 1000 visitors to my
site within the cfapplication applicationtimeout, I should only have to load
each UDFs once (on the first request), instead of 1 time for every page for
every visitor.  So if I have 1000 visitors who hit or refresh pages on
average 10 times, the UDFs will load 1 time vs 10,000 times.


And the cons against this are increased application scope management
(loading and locking), and the extra long reference I now have to include on
every UDF (which could be interpreted as forced scoping and organization,
and therefore a pro for this method.)


I remember reading something about CFMX 6.0 or 6.1 greatly speeding up UDFs,
CustomTags, etc instantiation.  So I'm not even sure if this is doing
anything in the larger scope of things.


I'm getting ready to get start developing on my current project and I'd like
to make a final decision for future projects as to whether this is a good
idea, or even necessary...and feedback would be appreciated->


Tyler Silcox


P.S.  I know this is purely for optimization sake, and that it probably
wouldn't greatly affect my application's performance either way.  But I
would like to know which way is "best", because it is going to affect just
about every part of my development...

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to