photo
Jordan Sissel
geek

Tue, 20 Apr 2004

boredom in my SE class

I was curious to see how much slower sprintf was in perl than an equivalent print statement. Using Debug::Profile hotness, after a million calls it turns out that sprintf is insignificantly slower. Yay boredom.

time elapsed (wall):   47.2054
time running program:  34.0098  (72.05%)
time profiling (est.): 13.1956  (27.95%)
number of calls:       2000000

%Time    Sec.     #calls   sec/call  F  name
60.20   20.4722        0  20.472220  *  
21.04    7.1548  1000000   0.000007     main::sp
18.77    6.3828  1000000   0.000006     main::nosp

sub sp {
   return sprintf("(%s) %s - %s\n", $album, $artist, $title);
}

sub nosp {
   return "(" . $album . ") " . $artist . " - " . $title . "\n";
} 

Comments: 0 (view comments)
Tags:
Permalink: /geekery/108
posted at: 11:39


0 responses to 'boredom in my SE class'


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment:


Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)

Tag Cloud

Calendar

< April 2004 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
252627282930 

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati