Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 ( #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? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-01-18 18:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (54 votes). Check out past polls.

    Notices?