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

The other replies have addressed some of the reactions I have regarding TT taking 60% of the response time. I have a few further questions.
  1. Assuming, of course, you used sane coding standards. Persistence can be a bitch if you're converting the first CGI script you ever wrote to run under MP::Registry.

------
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^4: Profiling/Benchmarking web applications.
by jryan (Vicar) on Aug 25, 2004 at 18:36 UTC

    Well...

    • Approx 1.25 seconds; caching the compiled templates took it down to approx 1 second.
    • yes
    • no
    • no, I'm use .item when working with nested hashes
    • Now that's something I didn't know. The main data section has nested loops four-deep. Column order is defined in a config file, so we do something like this:
      [% FOREACH set IN [data_header.top_priority, data_header.middle_priority] %] [% FOREACH fieldno IN set %] [% field = data_header.field.slice(fieldno, fieldno).0 %] [% value = order.item(make_key(field.title)) ...
      Which probably isn't very nice to the TT processor.
    • I wasn't, but I am now.
    • No, calls to the database are made through callback functions.
      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

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