String compare
Posted: Wed Sep 11, 2019 9:01 am
Hi
In my application I am experimenting with several comparing methods as Like, =, == at, $ etc.
Exist some diferencies when comare many many strings (milions rows) that I search method which is better for use.
For example like(text1,text2) is slower than at(text1,text2)>0 and this also slower than text1 $ text2
when compare about 10000000x then time to processing is 2.6 seconds or 1.81 seconds or 1.52 seconds.
If my processes running several hours this time is important and better method spare some time for me.
Exist some better way to comparing text that I shown ?
Also I experimented with compare by parts, first compare first letter, and only when this identical then compare full string, here are also some seconds to spare, but still exist better solution
or divide searched key to letters and compare as letter or ascii numbers, but this is not effective.
If somebody have some advice, I will be gratefull.
Note : I comparing strings in beginning row, but also in any place in row., still in one row, this is not full text searching. Text have own format, with some sign in begin rows etc.
function read rows in cycle to all text file and compare key text if is it in this row , by the way text file is loaded in array.
text can be as this :
searched text ABCDE
row : bla bla bla .... ABCDE bla bla bla
or
row : ABCDE bla bla bla...
Has some function better performance as $ ?
In my application I am experimenting with several comparing methods as Like, =, == at, $ etc.
Exist some diferencies when comare many many strings (milions rows) that I search method which is better for use.
For example like(text1,text2) is slower than at(text1,text2)>0 and this also slower than text1 $ text2
when compare about 10000000x then time to processing is 2.6 seconds or 1.81 seconds or 1.52 seconds.
If my processes running several hours this time is important and better method spare some time for me.
Exist some better way to comparing text that I shown ?
Also I experimented with compare by parts, first compare first letter, and only when this identical then compare full string, here are also some seconds to spare, but still exist better solution

or divide searched key to letters and compare as letter or ascii numbers, but this is not effective.
If somebody have some advice, I will be gratefull.
Note : I comparing strings in beginning row, but also in any place in row., still in one row, this is not full text searching. Text have own format, with some sign in begin rows etc.
function read rows in cycle to all text file and compare key text if is it in this row , by the way text file is loaded in array.
text can be as this :
searched text ABCDE
row : bla bla bla .... ABCDE bla bla bla
or
row : ABCDE bla bla bla...
Has some function better performance as $ ?