Re: Fastest/smallest search+replace
Re: Fastest/smallest search+replace
- Subject: Re: Fastest/smallest search+replace
- From: "Sven A. Schmidt" <email@hidden>
- Date: Mon, 14 May 2001 19:37:56 +0200
On Montag, Mai 14, 2001, at 05:43 Uhr, Stefan Lange-Hegermann wrote:
> Now to my problem:
> I am looking for the most efficient search and replace algorithm for
strings. It does not have to be
> strictly Cocoa, since I can convert my NSStrings to cstrings easily.
The problem is, that I need to
> replace the \n s in a string, which is at least 150 pages long when
printed out. All the attempts I tried
> are somewhat slow and I want it to be (or appear) instant.
How about breaking it up? It sounds like you want to display your
string - but who'll be able to grasp 150 pages of text instantly? You
might want to convert just the visible part while doing the rest in the
background. Maybe you even gain some performance wrt cache.
If you don't want to display it but indicate fast processing, add a
flashing button. Windows' copies are a lot faster since they have flying
documents and the OSX genie effect noticably speeds up window hiding ;-)
Sven