Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Profiling/Benchmarking web applications.

by jryan (Vicar)
on Aug 25, 2004 at 18:36 UTC ( [id://385769]=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Re^5: Profiling/Benchmarking web applications.
by dragonchild (Archbishop) on Aug 25, 2004 at 18:52 UTC
    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?

        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385769]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (8)
As of 2024-03-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found