logo       

Re: Perl 'Expert' Quiz-of-the-Week #22: msg#00104

Subject: Re: Perl 'Expert' Quiz-of-the-Week #22
Roger Burton West <roger-UvLOT2mcgw/NLxjTenLetw@xxxxxxxxxxxxxxxx> writes:

> (Is there a way of counting "operations" or "CPU steps" for a Perl
> program? That would be much more useful than timing for comparisons like
> this.)

What we could do is have some standard perl test program that
exercises a bunch of typical perl behavior, and quote time in terms of
relative times to that.  Yes, I'm aware that this conflates
memory/processor speed issues but it'll be something.

For example, if you use the code I posted Aug. 17th as my first
solution to problem 21 as the base*, then my word-finding program
currently does "love" to "hate" in three steps on Web2 (4 words) in
2% of base time.

The longest times are (not surprisingly) the times where there no path
exists, such as "worship" to "justice" which my program concludes in
8% of base time.  (Doing "octavo" to "herpes" takes only 7% of base)

We should decide, and I wish MJD had specified explicitly, how we're
handling case because that affects results.  (For instance, alcae _is_
on the Web2 list if you're working case-insensitively)

I propose that we all work case-insensitively,(**) and the test for
this is whether a path exists between "ruby" and "code" in Web2.  (The
path exists if you're case-insensitive, but not if you're being
case-sensitive)

The reason I propose case-insensitive as the default is that
case-sensitive turns Web2 into a much less interesting list, as far as
this problem is concerned.

(*) Probably not the best choice, as it requires input of Web2 to run,
and needs to have stdout redirected to /dev/null to avoid spewing all
over, and even then is very noisy on STDERR.  But it's what I had
available.  I welcome a different base proposal.  On my machine, base
time is 28.820 seconds.

(**) At least by default.  Options that explore alternate behavior are
always good.



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe