• 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: Syntax Colouring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax Colouring


  • Subject: Re: Syntax Colouring
  • From: Chris Boot <email@hidden>
  • Date: Tue, 29 Jul 2003 17:42:51 +0100

Hi All,

Thanks for everyone's input, it's all been extremely helpful!

After some research, I found that the -[NSMutableAttributedString addAttributes:range:] method was causing most of the slowdown in the code (and what a slowdown this was!). Replacing the calls to that method to addAttribute:value:range: improved things exponentially (no exact measurements, but we're talking several minutes down to a few seconds).

I am now going to write some code so that the whole document need not be scanned, only as little as possible. What I did until now was scan the whole document, but only apply attributes to whatever has been edited. I anticipate that this will improve colouring on huge files by a large amount (by huge I mean 500K or more).

I'll also see if I can release the code to the list / web so that people can see how I've done it.

--
Chris Boot
email@hidden
http://www.bootc.net/

#define QUESTION ((2b) || (!2b))
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Syntax Colouring (From: Chris Boot <email@hidden>)

  • Prev by Date: Re: Talking to the Dock (Nooo - stop it!)
  • Next by Date: Re: Talking to the Dock
  • Previous by thread: Re: Syntax Colouring
  • Next by thread: Initializing controls at startup
  • Index(es):
    • Date
    • Thread