[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What's the faster way to change attributes of string ?
From: |
Yen-Ju Chen |
Subject: |
What's the faster way to change attributes of string ? |
Date: |
Wed, 06 Aug 2003 11:28:40 -0400 |
Hi,
I'm improving the syntax-highlight in CodeEditorView right now.
What's the faster way to change thousands of attributes in NSTextStorage
once ?
I have two choices:
1. Build a new NSAttributedString and use [NSTextStorage
setAttributedString:].
2. Directly use -addAttribute:value:range: on NSTextStorage.
Is there any significant difference in speed between this two ways ?
It is slow when changing attributes of string larger than 80k (on Intel
PIII 700 machine).
By the way, I probably will release CodeEditor 0.4.1 recently.
It use built-in SAX-like parser to speed up the code parsing,
which is at least twice faster than previous regular-expression-based
method.
Bug report is welcome, but I'm focusing on CodeEditorView bundle right
now.
Some problem with user interface might not fixed in 0.4.1.
You can get the code from CVS. PCRE is not a dependency now.
It use posix regex for Find-and-Replace.
Yen-Ju
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
- What's the faster way to change attributes of string ?,
Yen-Ju Chen <=