in reply to Re^4: Profiling/Benchmarking web applications.
in thread Profiling/Benchmarking web applications

No, calls to the database are made through callback functions.

I guess I wasn't being specific enough. In apps using H::T, all database activity has to be completed before H::T can be used. However, TT allows you to make database calls while TT is running, and it sounds like you're using that functionality.

One way, obviously, is to use the DBI plugin. Another way is use callback functions, as you're using. I'll bet 1000XP that if you were to benchmark how much of the template time is being spent in those callbacks, it'll be at least 50%.

Also, I'm not a TT expert, but [% field = data_header.field.slice(fieldno,fieldno).0 %] looks horribly inefficient. Woudn't [% field = data_header.field.$fieldno %] suffice?

Update: Fixed to jryan's reply.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re^6: Profiling/Benchmarking web applications.
by jryan (Vicar) on Aug 25, 2004 at 19:18 UTC

    Wouldn't that have to be [% field = data_header.field.$fieldno %], which uses eval?

      You're correct - it would be $fieldno. But, why would you say it uses eval? Again, I've read the TT book, but I don't use it on an everyday basis, so I don't know it as well as I would like.

      ------
      We are the carpenters and bricklayers of the Information Age.

      Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      I shouldn't have to say this, but any code, unless otherwise stated, is untested

        Hey, I'm just going on what you told me. :)

        Update: Yikes, it definitely uses eval! My script's runtime went from ~0.85 seconds back up to 1.3 just after a global replace of s/(?<=\.)slice\((\w+),\1\)\.0/\$$1/g; (i.e. .slice(fieldno,fieldno).0 to .$fieldno)!