Re: Syntax Colouring
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.