The old replace all string function is so very slow when you have over 1000 chars to replace.
So I decide to make this function to replace all string with faster algorithm.
I make my function in DLL for easy to use with ASM or C at your choice (ntlib.dll).
In my DLL not only content replace all string function, it also content some of my favorite's function that I written in assembly.
I make 2 samples, once in C (M$ Visual C++) and once in ASM (MASM) to help you easy to understand my function.
Have fun
nt@phoenixodin2
So I decide to make this function to replace all string with faster algorithm.
I make my function in DLL for easy to use with ASM or C at your choice (ntlib.dll).
In my DLL not only content replace all string function, it also content some of my favorite's function that I written in assembly.
I make 2 samples, once in C (M$ Visual C++) and once in ASM (MASM) to help you easy to understand my function.
Have fun
nt@phoenixodin2
attached
As you can see, my function can replace 25088 chars in 1s with my P3 800 Mhz, 256 MB RAM (PC 800)
nhnpresario,
Nice work! :alright: Your application can be usefull to manipulate large
asm source files.
Regards,
Vortex
Nice work! :alright: Your application can be usefull to manipulate large
asm source files.
Regards,
Vortex
:alright:
That's right!
When we have a large asm file, if we want to change variable name or change function name, old algorithm so very slow.
That's right!
When we have a large asm file, if we want to change variable name or change function name, old algorithm so very slow.
The problem with notepad is not the algorithm but the fact that it scrolls the editbox to the text before replacing it to show you what's happening. *That's* slow. It's nice to have an alternative notepad that doesn't do this, although I usually use a 'real' editor for programming :).
Thomas
Thomas
Hi nhnpresario,
Very nice work and well documented.
This example is really useful for people that are interested in learning or changing from c to masm.
Thank you
ipadilla
Very nice work and well documented.
This example is really useful for people that are interested in learning or changing from c to masm.
Thank you
ipadilla
Nice... a fresh notepad-clone.. :) But just for the record.. Wordpad does have a very
fast replace algo.. ;)
fast replace algo.. ;)
Shouldnt this thread be moved to the algos and source code forum
nhnpresario,
"The old replace all string function is so very slow..."
Your search string algo is very slow too, and you can replace it with Boyer-Moore
algo for example
Regards,
Lingo
"The old replace all string function is so very slow..."
Your search string algo is very slow too, and you can replace it with Boyer-Moore
algo for example
Regards,
Lingo
;) He he
I don't think so.
I tested my function in 20 MB text with no problem(s).
As you know, my function with Whole Word specific (that still not presented in M$ Notepad) and Match Case specific but it can replace all or find or replace so fast.
I found Boyer-Moore in MASM package but I still not understand about his idea so I decided to make my own.
Now I make some change in my lib to optimize it may be faster (I think) by changed CharLowerA API to a customer function.
Have fun!:alright:
Best regards.
I don't think so.
I tested my function in 20 MB text with no problem(s).
As you know, my function with Whole Word specific (that still not presented in M$ Notepad) and Match Case specific but it can replace all or find or replace so fast.
I found Boyer-Moore in MASM package but I still not understand about his idea so I decided to make my own.
Now I make some change in my lib to optimize it may be faster (I think) by changed CharLowerA API to a customer function.
Have fun!:alright:
Best regards.