Gossamer Forum
Quote Reply
Efficiency
Thinking of speed efficiency regarding the execution of perl codes, which do you think is the most efficient in regard to a Plugin or a perl code Global. I have several custom built ones that could use either way.



~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: Sep 18, 2001, 3:17 AM
Quote Reply
Re: [Eraser] Efficiency In reply to
Hi,

Both of them are about the same in terms of speed. Plugins can do some things that globals can't (in terms of overriding core functions), but if yours can work either way, use plugins if you want to distribute them easily (but may take more work on getting the install done).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Efficiency In reply to
Alex,

That is a question I always have, and I try to figure it out based on the number of calls or routines that seem to need to get run, but is there some "benchmark" as to which is better?

I've been moving some of the "plugins" from true plugins to just a module that is located in the plugin directory.

I'm finding that using the template parser is easier over all, and in many ways more logical than having plugins all over the place.

The advantage of the plug in, of course, is setting up the "hooks" for setting configuration variables, and running each time a non-display routine is called.

For "display" functions, though, it seems using the template parser and the functions is "better" in many ways.

Benchmarks ?? :) <G>


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Efficiency In reply to
Hi,

Yes, definately. However the two are not exclusive. Your plugin can just install an extra template with instructions on how to call it. Or it can add a new module and tell you to put <%Plugins::YourPlugin::somecode%> in your template.

You should only use the hooks feature of plugins when you need to override a core piece of Links SQL logic.

I don't think the benchmark is useful as they accomplish different things. Maybe it's that people equate hooks => plugins, when in fact it is separate?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Efficiency In reply to
Could be:

1) Plugins -- something to add to, or change the functioning of the "distributed" links system, not included in the "core" distribution. Plugins can be run or called by hooks, they can be called directly by code (.cgi files) or can be called in from the templates using the <%function::function::call%> terminology.

2) Plugin system -- an easy way to distribute the code to others to do #1

3) Hooks -- a set of calls a plugin can use to override or change the behaviour of a key piece of "core" links code. A hook is a point in the "core" links code, when the program will check to see if a plugin exists, and if so, run it. Hooks run plugins, or cause plugins to run. They are a means of allowing 3rd party authors to change how Links does things (like the authentication system override for w3t or Goss Forum). Hooks are defined by the program authors (GT).







PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.