Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Re: Re: Re: Optimizing the bejeezus out of a sub

by sgifford (Prior)
on Jun 25, 2003 at 16:50 UTC ( [id://268916]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Optimizing the bejeezus out of a sub
in thread Optimizing the bejeezus out of a sub

The print is buffered, so only generates a system call when the buffer is full. My template is small and the buffer size is larger than it, so I only have one system call for the entire template.
#!/usr/bin/perl for(my $i=0;$i<4000;$i++) { print $i%10; }
$ strace -c -e write /tmp/t20 >/tmp/out
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000034          34         1           write
------ ----------- ----------- --------- --------- ----------------
100.00    0.000034                     1           total

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-18 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found