Posted 16 years ago
by David Green
I'm hoping someone can provide ideas about what we might do to speed up a Find & Replace operation that is taking a very long time. Just assume I'm doing everything wrong when you respond and try and provide me some direction.
Here's the scenario:
* Test .Net 2.0 app in C# hosting the SyntaxEditor control (latest version)
* Open a SQL file that contains about 23,000 lines of code
* Each line has an INSERT with a table name
* I open the Find & Replace dialog and tell it to look for the curent table and replace it with a new table name (no options are checked on the dialog - no mark with bookmarks, no match whole word, no match case, no search hiddent text, and no search in selection)
* Click Replace All
* 100% CPU for 10 minutes and then I kill the app (I'm on a Pentium M 2.13GHz laptop)
* Document is attached to the control - not disconnected
So, I know I must be doing something wrong. My text editor can do this in .2 seconds so 10 minutes+ seems ridiculous and clearly points the finger at me. And by me, I mean my developer.
How would you implement a fast Find & Replace when you knew that 23,000 replaces would have to happen for the operation to complete?
All answers welcome and you won't make me feel foolish since it's one of my developers who will be yelled at when I finally figure it out for him.
Thanks.
--
David
Here's the scenario:
* Test .Net 2.0 app in C# hosting the SyntaxEditor control (latest version)
* Open a SQL file that contains about 23,000 lines of code
* Each line has an INSERT with a table name
* I open the Find & Replace dialog and tell it to look for the curent table and replace it with a new table name (no options are checked on the dialog - no mark with bookmarks, no match whole word, no match case, no search hiddent text, and no search in selection)
* Click Replace All
* 100% CPU for 10 minutes and then I kill the app (I'm on a Pentium M 2.13GHz laptop)
* Document is attached to the control - not disconnected
So, I know I must be doing something wrong. My text editor can do this in .2 seconds so 10 minutes+ seems ridiculous and clearly points the finger at me. And by me, I mean my developer.
How would you implement a fast Find & Replace when you knew that 23,000 replaces would have to happen for the operation to complete?
All answers welcome and you won't make me feel foolish since it's one of my developers who will be yelled at when I finally figure it out for him.
Thanks.
--
David