• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A puzzle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A puzzle


  • Subject: Re: A puzzle
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sat, 22 Nov 2008 08:44:15 -0500

On Sat, Nov 22, 2008 at 6:36 AM, Skeeve <email@hidden> wrote:
> Now try this on your machine, please:
>
> $ time perl -e 'for ($_=1000000;--$_;) { $count+= tr/1/1/; } print $count'

Yup, sub-second now. 0.8s the first time, 0.4 thereafter.  I had
already used a similar technique in some other languages but hadn't
gotten around to trying it in Perl yet.

Very nice.

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >A puzzle (From: Michelle Steiner <email@hidden>)
 >Re: A puzzle (From: Luther Fuller <email@hidden>)
 >Re: A puzzle (From: "Mark J. Reed" <email@hidden>)
 >Re: A puzzle (From: Skeeve <email@hidden>)

  • Prev by Date: Re: A puzzle
  • Next by Date: Re: Transliteration, TextCommands osax
  • Previous by thread: Re: A puzzle
  • Next by thread: Re: A puzzle
  • Index(es):
    • Date
    • Thread