http://www.perlmonks.org?node_id=688196


in reply to A profiling surprise ...

chexmix,
IO tends to be an overshadowing bottle neck. This is the nature of the beast. You may want to read:

I disagree with the other monk in the thread that said to move as much as possible away from the DB. In general, you want to reduce the number of times that you ask the database to do work for you. The work that you do leave for the DB should be work that the DB is good at. For instance, don't sort your records in perl land if it makes sense to use an "order by" clause.

You should also recognize that DBI is a pretty heavy API even though great work continue to goes into optimizations. The abstraction layer between you and the DB which makes you able to write programs faster also means the program runs slower.

Without seeing the code nor data, it is hard to provide more than general advice. The code you indicated sounds like it would easily fit into <readmore> tags. If you want specific help - share the code.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: A profiling surprise ...
by chexmix (Hermit) on May 23, 2008 at 20:46 UTC
    Limbic~Region,

    Thanks. I will read those linked documents and see how they simmer.

    Silly question regarding the posting of code ... I suppose I need to ask internally where I work, but has there ever been a case of someone posting code here and getting in hot water at work for doing so? I'm probably just being paranoid, but visions of sugar-plum non-disclosure statements are dancing in my head.