Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Template.pm vs. GT::Template performance

Quote Reply
Template.pm vs. GT::Template performance
Just FYI, I tried out how the old Links 2.0 performs, if we replace just one part of it: the template parser.
I was curious, how much performance can I get using GT::Template over the old Template.pm?
Maybe several of you also asked this question from yourself, so I thought this info would helpful for you.

BTW: Don't blame me about how the tests was done! Different live tests would likely show different results! This test was based on my live site, without the goal to do a very accurate test. However IMO, it shows the power of GT::Template...

I changed the parser to GT::Template and executed the same build event using each parser.
You are curious for the results, eh? Wink
Well, the results are what I expected. GT::Template is much-much faster, than Template.pm.

Here they are the numbers:
1) Test results after parsing 1 page:
Template.pm: Time spent template parsing 1 template: (0,015 s)
GT::Template: Time spent template parsing 1 template: (0,002 s)
That's 7.5x faster!
One page does not really shows the possibilities, so we should see the test results after parsing more than 1 hundred pages.

2) Test results after parsing more than 1 hundred pages:
Template.pm: Work time of all template parsing: (15,43 s)
GT::Template: Work time of all template parsing: (0,90 s)
That's more than 17x faster than old Template.pm!

That's all folks!
I hope you enjoyed! Cool

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Template.pm vs. GT::Template performance In reply to
Cool

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Template.pm vs. GT::Template performance In reply to
You'd have to get Alex to write a new parser to get a fair comparison.
Quote Reply
Re: [Paul] Template.pm vs. GT::Template performance In reply to
I'm hurt! Pirate I wrote most of the current GT::Template's speed optimizations.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Last edited by:

Jagerman: Feb 8, 2003, 12:08 AM
Quote Reply
Re: [Jagerman] Template.pm vs. GT::Template performance In reply to
On searching for a specific issue I came across these posts and thought I would ask here.

In environment we see these arguments being displayed and we cant understand them:-----

Stack Trace
======================================
Links (9405): Links::environment called at GT::Template::_call_func line 764 with arguments
(0).
Links (9405): GT::Template::_call_func called at /home/www/oursite/cgi-bin/links/admin/templates/admin/compiled/setup_env.html.compiled line 51 with arguments
(GT::Template=HASH(0x824aa60), Links::environment, 0).
Links (9405): GT::Template::parsed_template called at /home/www/oursite/cgi-bin/links/admin/GT/Template.pm line 600 with arguments
(GT::Template=HASH(0x824aa60)).
Links (9405): GT::Template::_parse called at /home/www/oursite/cgi-bin/links/admin/GT/Template.pm line 97 with arguments
(GT::Template=HASH(0x824aa60), setup_env.html, HASH(0x824aaf0)).
Links (9405): GT::Template::parse called at /home/www/oursite/cgi-bin/links/admin/Links.pm line 250 with arguments
(GT::Template, setup_env.html, ARRAY(0x824ab50), HASH(0x824aaf0)).
Links (9405): Links::admin_page called at admin.cgi line 50 with no arguments.
Links (9405): main::main called at admin.cgi line 24 with no arguments.

Can anyone shed any light on whats going on here and how to correct the errors?

Tom Henry

Last edited by:

tomhenry: Nov 9, 2006, 6:02 AM
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
Hi,

Sorry, what don't you understand?

Stuff like this:

Quote:
Links (9405): GT::Template::_call_func called at /home/www/oursite/cgi-bin/links/admin/templates/admin/compiled/setup_env.html.compiled line 51 with arguments

..is just debug information, letting you know that the GT::Template::_call_func() function was called (a normal process, which does the "magic" in creating the HTML page, based on a template - in this case setup_env.html).

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Template.pm vs. GT::Template performance In reply to
Hi Andy,

so cool then. the arguments dont mean its broke in anyway?
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
What we are trying to do is find the fault with our searches.

this is the debug info on this error:-----

Links (1198): Links::fatal called at (eval 42) line 13 with arguments
(Died at (eval 42) line 13.

Any ideas?

Tom Henry
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
Hi,

Does this error happen all the time, or only randomly? (or seemingly random, as there is nearly a logical reason/condition that the error is coming up).

Also, do you have a search_logging turned on in Setup > Search Options? Its a long shot - but if its turned on, try turning off.

Hopefully I can help a bit more .. just a bit vague at the moment =)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Template.pm vs. GT::Template performance In reply to
Hi again,

I have just received the error info when carrying out a search:-----


A fatal error has occured:
Died at (eval 42) line 13.
Please enable debugging in setup for more details.
Stack Trace
======================================
Links (31102): Links::environment called at /home/www/oursite/cgi-bin/links/admin/Links.pm line 430 with no arguments.
Links (31102): Links::fatal called at (eval 42) line 13 with arguments
(Died at (eval 42) line 13.
).
Links (31102): Links::__ANON__ called at GT::Template::_call_func line 764 with arguments
(fish).
Links (31102): GT::Template::_call_func called at /home/www/oursite/cgi-bin/links/admin/templates/default/compiled/search_results.html.compiled line 23 with arguments
Links (31102): GT::Template::parsed_template called at /home/www/oursite/cgi-bin/links/admin/GT/Template.pm line 600 with arguments
(GT::Template=HASH(0x866f568)).
Links (31102): GT::Template::_parse called at /home/www/oursite/cgi-bin/links/admin/GT/Template.pm line 101 with arguments
(GT::Template=HASH(0x866f568), search_results.html, HASH(0x86712f0)).
Links (31102): GT::Template::parse called at /home/www/oursite/cgi-bin/links/admin/Links.pm line 291 with arguments
(GT::Template, search_results.html, ARRAY(0x8670a38), HASH(0x86712f0)).
Links (31102): Links::user_page called at (eval 53) line 1 with arguments
(search_results.html, HASH(0x8602ba8), HASH(0x86712f0)).
Links (31102): Links::SiteHTML::site_html_search_results called at /home/www/oursite/cgi-bin/links/admin/GT/Plugins.pm line 107 with arguments
(HASH(0x8602ba8), [undef]).
Links (31102): GT::Plugins::dispatch called at /home/www/oursite/cgi-bin/links/admin/Links/SiteHTML.pm line 28 with arguments
(GT::Plugins, /home/www/oursite/cgi-bin/links/admin/Plugins, site_html_search_results, *Links::SiteHTML::site_html_search_results, HASH(0x8602ba8), [undef]).
Links (31102): Links::SiteHTML::display called at /home/www/oursite/cgi-bin/links/admin/Links/User/Search.pm line 74 with arguments
(search_results, HASH(0x8602ba8)).
Links (31102): Links::User::Search::search called at /home/www/oursite/cgi-bin/links/admin/Links/User/Search.pm line 48 with no arguments.
Links (31102): Links::User::Search::handle called at /home/www/oursite/cgi-bin/links/admin/GT/Plugins.pm line 107 with no arguments.
Links (31102): GT::Plugins::dispatch called at search.cgi line 25 with arguments
(GT::Plugins, /home/www/oursite/cgi-bin/links/admin/Plugins, handle_search, CODE(0x8235b8c)).

Does this help at all?

Thanks for any guideance you can give:)


Tom Henry

p.s. happens all the time. sorry forgot to say

Last edited by:

tomhenry: Nov 10, 2006, 6:48 AM
Quote Reply
Re: [Andy] Template.pm vs. GT::Template performance In reply to
In Reply To:
Hi,
Also, do you have a search_logging turned on in Setup > Search Options? Its a long shot - but if its turned on, try turning off.
Cheers

Just asked. They say there is no option like that in there. so I guess no.
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
In Reply To:
Just asked. They say there is no option like that in there. so I guess no.
Which version of LinksSQL (or Gossamer Links) are you using?

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Template.pm vs. GT::Template performance In reply to
In Reply To:
In Reply To:
Just asked. They say there is no option like that in there. so I guess no.

Which version of LinksSQL (or Gossamer Links) are you using?

Cheers

I'll ask brb
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
Version: 2.1.2
Quote Reply
Re: [tomhenry] Template.pm vs. GT::Template performance In reply to
Andy,

'tis fixed. tnxs for yr support. My daughter went back to seller in US and they told her that it was a plugin problem with an external search engine type advertisers search script that was making it fall over. They fixed it last night.

Tom Henry