• 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: Reformatting a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reformatting a string


  • Subject: Re: Reformatting a string
  • From: Jon Pugh <email@hidden>
  • Date: Sun, 29 Jan 2012 19:44:50 -0800

On Jan 29, 2012, at 4:59 PM, Shane Stanley wrote:
> I then tried some tests with the SmartString vanilla method. With a short string, say a few characters, it was super fast. But as the length of the string went up, the time taken increased exponentially -- for a 128-byte string it took about 6 seconds, for 256, about 26 seconds, and for 512, 126 seconds. So it started off more than competitive, but got left behind very quickly. A 256-512 characters is not a large string in the real world.

Yeah, there’s a double loop in there that’s likely the culprit.  I just recently fixed an issue with a missing “exit repeat” to short circuit the loop when it finds a match, however I’m sure there’s a bunch of special case optimizations that could occur.  Especially on strings that don’t need case operations.  The current algorithm isn’t designed for speed, it’s designed for flexibility.

C has a lot more capability for speed when doing string manipulation.  AppleScript tends to bog down when doing anything involving iterating over strings.

Nevertheless, I’ll look into making it faster as time permits.

Thanks.

Jon


 _______________________________________________
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


  • Follow-Ups:
    • Re: Reformatting a string
      • From: Axel Luttgens <email@hidden>
    • Re: Reformatting a string
      • From: Shane Stanley <email@hidden>
References: 
 >Reformatting a string (From: Angelo <email@hidden>)
 >Re: Reformatting a string (From: Luther Fuller <email@hidden>)
 >Re: Reformatting a string (From: Jon Pugh <email@hidden>)
 >Re: Reformatting a string (From: Shane Stanley <email@hidden>)
 >Re: Reformatting a string (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Reformatting a string
  • Next by Date: Re: Reformatting a string
  • Previous by thread: Re: Reformatting a string
  • Next by thread: Re: Reformatting a string
  • Index(es):
    • Date
    • Thread