Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: temp hold logfiles in memory?

by graff (Chancellor)
on Mar 19, 2011 at 17:04 UTC ( [id://894166]=note: print w/replies, xml ) Need Help??


in reply to temp hold logfiles in memory?

As indicated in the first reply, it seems likely that your diagnosis of the bottleneck is a bit off the mark. What sort of evidence do you have about where most of the runtime is being spent? Have you profiled the code in any way?

Replies are listed 'Best First'.
Re^2: temp hold logfiles in memory?
by TRoderic (Novice) on Mar 19, 2011 at 17:22 UTC
    my diagnosis is perhaps incorrectly based on noticing about 4-5 seconds per minute improvement running the same batch with a 1 megabyte buffer with that loop I posted against the default file handle method.

    I'm generally trying to move most of the operation into memory, as the process itself consists of 300 lines of regex match statements for looping through plain text and/or html files.

    as for profiling the code, i'm still very much of a novice and am only now branching into code optimisation. if you've got some pointers there it would be greatly appreciated :)

      You may want to also benchmark the "300 lines of regex match statements". These statements may be taking more time than the I/O, so don't rule them out. For example, could a simple "index" replace some of the regex tests. Also look at the order of the tests, sometimes just reordering the sequence of tests will improve performance.

      Good Luck

      "Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found