Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: chargen program is too slow / IO::Select socket handle outputting timing issue

by Jeppe (Monk)
on Jul 11, 2006 at 12:23 UTC ( [id://560425]=note: print w/replies, xml ) Need Help??


in reply to chargen program is too slow / IO::Select socket handle outputting timing issue

When I run into performance trouble, I do like this:
use Time::HiRes; my $ENABLE_PROFILING = 1; my $exit_genchars_time = 0; ... sub exit_genchars { my $temp_time = Time::HiRes::time() if $ENABLE_PROFILING; log_event("Exit called\n"); $exit_genchars_time += Time::HiRes::time() - $temp_time if $ENABLE_PROFILING; exit(0); } ... sub END { if ($ENABLE_PROFILING) { print "Spent " . sprintf("%.2f") . " seconds inside exit_genchars\n"; ... ... } }
etc. It ain't very pretty. It's low-tech, not very expensive, fairly easy to remove afterwards, and most of all in my domain: Thread-safe.
  • Comment on Re: chargen program is too slow / IO::Select socket handle outputting timing issue
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found