Correct, I would think the request scope would be better for global
variables than passing them to custom tags. Remember that the copying of
variables happens for each call to a custom tag, so if you had 40
variables that need to be passed for 40 different calls to custom tags
then that is a total of 1600 copies. Although, if you are using quite a
number of global variables you may also want to look into using the
application scope.

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]

> -----Original Message-----
> From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 10:04 PM
> To: CF-Talk
> Subject: Re: local vs. request
> 
> So in the case of 40 or so variables.whatever being set, you like the
idea
> of setting them as request.whatever and thus the custom tags can use
these
> settings without having to dupe up on them either as attributes or
calling
> the preference file within the custom tag.
> 
> I just want it to make sense to those who are looking at the code.
> (comment
> away!)
> 
> Thanks
> Paul Giesenhagen
> QuillDesign
> 
> ----- Original Message -----
> From: "Matt Liotta" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Wednesday, July 24, 2002 11:57 PM
> Subject: RE: local vs. request
> 
> 
> > Just to note, there is a performance difference between your two
> > methods. Specifically, passing data through the attributes scope of
a
> > custom tag causes a copy of the variable to happen. As you can
imagine
> > copy variables can have a performance impact if there is a
significant
> > number of variables to copy and/or variables with a large amount of
> > data.
> >
> > Matt Liotta
> > President & CEO
> > Montara Software, Inc.
> > http://www.montarasoftware.com/
> > V: 415-577-8070
> > F: 415-341-8906
> > P: [EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Dave Watts [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, July 24, 2002 9:52 PM
> > > To: CF-Talk
> > > Subject: RE: local vs. request
> > >
> > > > I have an application that sets many different local
> > > > variables (about 40 or so) on each page load ... We are using
> > > > a few custom tags here and there and it would be great to use
> > > > the request scope instead of local just for ease of use.
> > > >
> > > > Does anyone have any comments on performance of setting local
> > > > vs. request scope variables?  What if any are some of the
> > > > drawbacks of going this way?  Resources, speed ect..
> > >
> > > It will make absolutely no noticeable difference as far as
> > performance. It
> > > will only make a difference in a conceptual sense. By that, I mean
> > that if
> > > you write CFML custom tags with clearly defined inputs and outputs
(to
> > the
> > > degree that you can clearly define outputs in custom tags), the
> > Request
> > > scope won't be especially useful; on the other hand, you can write
> > your
> > > custom tags a little more loosely so that they take advantage of
the
> > > Request
> > > scope. Personally, I generally prefer the first approach.
> > >
> > > But again, it won't affect performance one way or the other.
> > >
> > > 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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to