[Dancer-users] questions about speed

Nick Knutov mail at knutov.com
Sun Oct 2 23:27:40 CEST 2011


Hello all,

today I found, that previous version of our project (hosting billing 
system), written on perl, fastcgi and using CTPP as template engine 
generates pages faster, then new version of this project, written with 
dancer and ctpp and running with plackup/starman. The most part of the 
code remains the same, but we add cache(*) and reduce the number of SQL 
queries (this led to an increase of speed - we checked it).

So the question - where should I look for the problem?

The first idea - I know that HTML::CTPP2->new() takes a lot of time. It 
is called in Dancer::Template::Ctpp2, which is `use base 
'Dancer::Template::Abstract';`
so the question - is sub init() in this module runs only once when 
starting the app, or on every query?

The second question - can this be because of plackup or starman? Where 
should I look in this case?

ps: plackup -E production -s Starman --workers=4 -l bill.sock -a 
bin/app.pl

One parallel query in all cases.

pps: (*) about our cache - just in-memory hash with already loaded data 
from db, which returns already loaded data instead of making new query - 
this can not lead to taking more time on requests. And, without this 
cache, with the old code, it's just slower.

-- 
Best Regards,
Nick Knutov
http://knutov.com
ICQ: 272873706
Voice: +7-904-84-23-130


More information about the Dancer-users mailing list