Re: Re: [Mason-checkins] CVS: mason/dist/lib/HTML/Mason/Resolver File.pm,1.86,1.87

Dave Rolsky <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Tue, 12 Oct 2004, Jonathan Swartz wrote:

> Adding new elements would be easy as long as you add them to the end of
> the list. Plugin hooks don't have to grab everything from @_.
>
> I acknowledge your point, and originally supported passing a hashref or
> hash. That was before I took a close look at performance. IMO it's
> critical to streamline $m->comp, to bring component calls as close as
> possible to subroutines without sacrificing user features. Creating a
> hash for both start and end plugins, then copying that hash twice when
> you call each plugin hook, is unnecessarily wasteful.
>
> I could be convinced to change it back to a hashref and reusing the
> hashref for both the start and end hook (with more info available to the
> end hook). But passing/copying the full hash sacrifices performance for
> no other reason than we've always passed hashes in the past.
>
> Though I actually think the plugin code reads better when everything is
> passed in @_, e.g. $comp and $args instead of $context->{comp} and
> $context->{args}.

I'm ok with hash ref, since a plugin author can use Params::Validate to
convert it to a hash or hashref as they please ;)

I don't know why you're optimizing the plugin case, though.


-dave

/*===========================
VegGuide.Org
Your guide to all that's veg.
===========================*/


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.