[New Plugin] MultiReplace
-
Hello, @thomas-knoefel and All,
Again I made a comparison between the
Notepad++ v8.9.8,Search++ v0.72andMultiReplace v6.2Search in Files feature against all files of myDUSB key.All the Search results panels return
27,053hits in646files of1,153searched, obtained in :-
1m 43sfor Notepad++ -
1m 13sfor MultiReplace -
2m 18sfor Search++

As previously, I unpluged my USB key, restarted my computer and repluged my key before any Search in Files action
Your list of improvements, in your latest relesase, are quite impressive ! And probably, my test does not exploit all the features of your plugin. I still need to carefully read your documentation !
Best Regards,
guy038
-
-
Hi @guy038,
thanks for testing again! In case you’re curious, here’s roughly what the new loading threads in 6.2 do.
As soon as the file list is known, a few worker threads start reading ahead: they open the files, read them, check for binary content and decode the text. The main thread takes the files in list order as soon as each one is ready, puts it into a hidden Scintilla document and searches it. So the hits and their order stay the same, but reading and searching now overlap.
On a USB stick MultiReplace uses four threads by default. With a cold cache, as in your test, most of the time goes into waiting for your USB key, and that is where it helps: up to four files are read at the same time, and the search runs while the next ones are still loading.
If you want to see what the threads bring on your key: with
LoadThreads=0in the[ReplaceInFiles]section of the INI file, every file is read on the main thread as before (see the README; it takes effect after restarting Notepad++). -
Hello, @thomas-knoefel and All,
Indeed, changing the line :
LoadThreads="auto"into this one :
LoadThreads=0within the
MultiReplace.inifile, the same list of files were found in2 m( instead of1 m 13 s)
Thus, I decided of an experiment, changing, on purpose, the
LoadThreadsline to :LoadThreads=8After restarting my computer and doing the test, the execution time was, this time,
1 m 28 s. However, verifying within theMultiReplace.inifile, I saw the line :LoadThreads="0"Is this the expected behavior, with the number
0as a string ?Best Regards,
guy038
-
Hi guy038,
interesting series of runs, thanks! Both runs without threads, the 2 m one and most likely the 1 m 28 s one too (see below), are slower than the 1 m 13 s with
auto. So the threads do help on your key, even if cold runs vary quite a bit.Yes, the quotes are expected.
LoadThreadsis stored as text because it can also be"auto", and the quotes are removed when the file is read, so0and"0"mean the same.What changed your 8 back to 0 is something else: MultiReplace reads its INI file once at startup and, once its panel has been opened, writes all its settings back when Notepad++ closes. An edit made in the meantime is therefore overwritten on exit. So your 1 m 28 s run most likely still used
LoadThreads=0.To test 8: change the line either in Notepad++ before opening MultiReplace, or with another editor while Notepad++ is closed. Then restart Notepad++, and the new value is used.
Curiously, in my experience with other tools, four to six parallel threads were always the optimum.
-
Hi, @thomas-knoefel and All,
For these Search Results :
Search "Fi" (27 010 hits in 646 file(s)) [1 153 file(s) searched], I got, successively, using your valuable instructions :-
1 m 13 s 78, then1 m 10 s 85and finally1 m 11 s 06whenLoadThreads="auto" -
1 m 25 s 78and1 m 26 s 39whenLoadThreads="0" -
1 m 09 s 54and1 m 09 s 55whenLoadThreads="8"
So, the two tests with
LoadThreads="8"seem very slightly better !?
Note that :
-
From Laptop documentation, my processor is an
Intel® Core™ i7-1165G7 2.80 Ghz (up to 4.7 GHz with Intel® Turbo Boost Technology ) 12 MB L3 cache, 4 cores 8 logical processors -
From informations système, I saw for Processeur :
11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 2803 MHz, 4 cœur(s), 8 processeur(s) logique(s) -
Total installed RAM :
32 Gb
This explain why I wanted to test with
8threads. But, may be this assumption is not pertinent ! ?Best Regards,
guy038
-
-
Hi @guy038 ,
to your question about the 8 logical processors: they don’t really matter here. The load threads do very little computing, they mostly wait for the key to deliver the next file. How many reads can usefully run at once depends on the drive, not on the CPU. That’s why
autopicks the count by drive type: 4 for local drives like your key, 8 for network drives, where every file waits for the server, and 1 for hard disks, where parallel reads would just make the heads jump back and forth. On a key with a weaker controller, 8 could just as well be slower than 4. On yours it’s slightly faster, so feel free to keep it. 8 is also the maximum.One more thing: your first comparison showed 27 053 hits in the same 646 files, now it’s 27 010. Did anything change on the key in between?
-
Hi, @thomas-knoefel,
Thanks for your explanations. As you said :
How many reads can usefully run at once depends on the drive, not on the CPU
Thus, the
LoadThreads="auto"option, in theMultiReplace.inifile, globally means :-
1thread, in case of hard disks drives -
4threads, in case of local drives -
8threads, in case of network drives
BTW, how SSD drives are considered ? Like the HD drives case, I suppose ?
Regarding the differences in results of the search, I certainly deleted some files between the
October, 27and theOctober, 30. I can’t remember !In the meanwhile, on November 1, I deleted an
890x64folder and created a new899x64folder on my USB key. Thus, today, running again the3search engines ( N++, MultiReplace and Search++ ) within my localN++ v8.9.9install, I get, this time :Search "Fi" (25 921 hits in 642 file(s)) [1 151 file(s) searched]for all regex enginesBest Regards,
guy038
-
-
Hi @guy038,
your summary is right. By hard disks I meant the classic ones with spinning platters. SSDs get 4 threads, like your key. MultiReplace asks Windows whether a drive has a seek penalty, which only drives with moving read heads report. Those get 1 thread, CD/DVD drives too, and to be safe also USB disks that don’t answer that question.
And thanks for checking the hit counts, good to see all three engines agree.
-
MultiReplace 6.3 is out.
Its main new feature is Mark Replacements: you see in the text what Replace All changed and what was there before, and you can put back single replacements or a whole passage without undoing the rest. Find/Replace in Open Documents can now also be limited to the tabs you colored in Notepad++.
Download: Latest build
Key Features & Improvements
- Mark Replacements: Switch it on in the plugin menu, and after Replace All every replaced spot keeps a dotted underline and every deletion a small triangle. Hover a mark to see what was there before and which list entry made it.
- Revert Replacement: Select a passage and right-click it, or right-click a single mark, and only that passage gets its original text back while all other replacements stay. The same menu steps from change to change and selects the list entry.
- Tab Color Filter: Color the tabs you want in Notepad++, and Find/Replace in Open Documents can work on just those (Notepad++ 8.6.8 or later).
- Selection Scope Frame: In Selection scope, a light frame shows the searched area while you step through the matches.
- Column Highlight and Flow Tabs: Column highlight and sort state stay with their document when you switch tabs, and the Flow Tabs alignment is never saved or copied.
- Add into List: New entries go to the end of the list, or to the top if you prefer, and scrolling to them can be turned off.
- Other Plugins and Editor Themes: Marks stay visible and keep their colors next to plugins such as Columns++ and Search++, and the colors drawn into the text follow the editor theme.
- Fixes from the review: The whole plugin went through a code review, the fixes are listed in the release notes.
- Translations: Labels checked in all languages and scalings, and the Russian translation revised.
Mark Replacements


Tab Color Filter

All changes are in the release notes.
Issues or suggestions: GitHub
Happy replacing!
-
Hello, @thomas-knoefel and All,
For example, in the screenshot below, using these different search-replacements, against the text below, I got these search results !
Notepad++ is a text editor and source code editor for use under Microsoft Windows. It support around 80 progamming languages with syntax highlighting and code folding. It allows working with multiple open files in a single window, thanks to its tabbed editing interface. Notepad++ is available under GPL and distributed as free software. Notepad++ is a text editor and source code editor for use under Microsoft Windows. bla bla blah It support around 80 progamming languages with syntax highlighting and code folding. It allows working with multiple open files in a single window, thanks to its tabbed editing interface. Notepad++ is available under GPL and distributed as free software.
But, after clicking, on the
Next Search Result, The cursor went, successively, right after :• The word 'Notepad++' only, in line 1 • The word 'Notepad++' only, in line 4 • The string 'aournd 80' only , in line 7 • The word 'multiple' only, in line 8 • The word 'Notepad++ only, in line 9Thus, if I’m not mistaken, I consider that the options
Next Search ResultandPrevious Search Resultshould rather be labelled asNext Line ResultandPrevious Line Result! May be, I’m miss something obvious !?On the contrary, when I subsequently ran a
Replace Alloperation, theNext ReplacementandPrevious Replacementoptions did go, in turn, to the different replacements, particularly in case of several replacements in a same line !
Now, in your documentation, within the
Settingssection, you said regarding theFind: Search from cursor positionoption :Find: Search from cursor position — If checked and Wrap around is off, “Find All”, “Replace All”, and “Mark Matches” start from the current cursor position. Runs over open documents or files never start at the cursor. If unchecked, operations always process the entire defined scope.
So, if I understand you clearly, this behavior can be summarized in the table below :
•================================•========================================•========================================•========================================•========================================• In Settings\Search and Replace | Find: Search from cursor position ON | Find: Search from cursor position OFF | Find: Search from cursor position ON | Find: Search from cursor position OFF | | | | | | In MultiReplace dialog | Wrap around OFF | Wrap around OFF | Wrap around ON | Wrap around ON | •================================•========================================•========================================•========================================•========================================• | Find all | From CURSOR location | From START of file | From START of file | From START of file | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Find in Docs | From START of files | From START of files | From START of files | From START of files | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Find in Files | From START of files | From START of files | From START of files | From START of files | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Replace All | From CURSOR location | From START of file | From START of file | From START of file | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Replace in Docs | From START of files | From START of files | From START of files | From START of files | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Replace in Files | From START of files | From START of files | From START of files | From START of files | •--------------------------------•----------------------------------------•----------------------------------------•----------------------------------------•----------------------------------------• | Mark Matches | From CURSOR location | From START of file | From START of file | From START of file | •================================•========================================•========================================•========================================•========================================•And I’m really confused because these two options seem to serve the same purpose ! I probably misunderstood the underlying logic behind these two options. Please enlighten me on this !
Best Regards,
guy038
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login