Hi Chip,

> It is easy, it is simple, and it results in better then 650x improvement in 
> speed, and it should not hurt if used in a version where the 4D has rewritten 
> the replace string code.  (which is where? which
version?)

The change occurred in v15R3.
It is 990 times after when based on Character code (* passed)
It is 4400 times faster when based on Character (* omitted)

See more details here (page 23):
ftp://ftp-public.4d.fr/Documents/Products_Documentation/LastVersions/Line_15R3/VIntl/4D_Upgrade_v15_R3.pdf
{
Thanks to a new internal algorithm, the execution of the Replace string command 
has been significantly accelerated in 4D

v15 R3 when you replace a string by another of a different length. This is the 
case for example in the following replacements:

vResult:=Replace string(Source_Text;"a";"aa") //based on characters
vResult2:=Replace string(Source_Text2;"à";"aa";*) //based on character codes

The new algorithm is optimized for both syntaxes: the larger the source text 
and the more replacements there are, the more
significant the optimization will be.

Our benchmarks show the following results, compared with the previous algorithm:

Replacements based on character code (* passed) Replacements based on character 
(* omitted)
About 950 times faster About 4400 times faster

These tests were done by replacing "a" with "aa" in a file containing 32,000 
occurrences to replace.
Note: Replacement of strings of the same length is just as fast as with the 
previous algorithm
}

-Tim PENNER



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to