Re: [SPOILER] Solution to Perl 'Expert' Quiz-of-the-Week #22
Rod Adams <[email protected]>
| Newsgroups | gmane.comp.lang.perl.qotw.discuss |
|---|---|
| Message-ID | <[email protected]> |
Ronald J Kimball wrote: >On Mon, Aug 30, 2004 at 11:48:22AM -0500, Rod Adams wrote: > > > >>The interesting thing is that with the 'words' list, compound is faster >>than simple: >> >>D:\Code\QotW\22e>bench.pl words >> Rate compound simple >>compound 5.07/s -- -63% >>simple 13.9/s 174% -- >> >> >>where as with 'web2', compound is slower: >> >>D:\Code\QotW\22e>bench.pl web2 >> s/iter compound simple >>compound 3.99 -- -45% >>simple 2.18 83% -- >> >> >> > >Simple is faster in both those benchmarks; cmpthese() always orders the >results from slowest to fastest. It's just that the ratio is reversed >between the two results sets; the first has iterations per second, the >other has seconds per iteration. > > >Ronald > > > Teaches me to just look at the numbers and expect a consistent interface, when nothing but the numbers should be changing. Grr.