Path: csiph.com!news.mixmin.net!aioe.org!wIgm+2MIUUYkuZKIR0Uhug.user.gioia.aioe.org.POSTED!not-for-mail From: "R.Wieser" Newsgroups: microsoft.public.scripting.vbscript Subject: Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) Date: Sun, 3 Jan 2021 16:01:10 +0100 Organization: Aioe.org NNTP Server Lines: 27 Message-ID: References: NNTP-Posting-Host: wIgm+2MIUUYkuZKIR0Uhug.user.gioia.aioe.org X-Complaints-To: abuse@aioe.org X-RFC2646: Format=Flowed; Original X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-Notice: Filtered by postfilter v. 0.9.2 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: csiph.com microsoft.public.scripting.vbscript:12332 Mayayana, > | The whole process using the 25 MB string still takes several > | seconds to complete though. Oh well. > Did you try a UCase or LCase first and then ReadAll? Whut ? How do you suppose I would be able to do that ? I would think I would need to read the data before being able to act upon it .... > I don't see the point of reading by line The drawback of reading everything into memory and doing an initial lcase or ucase is that you have to assume that none of the files data is in a mixed-case form thats important to the user. In my case the OSM file contains name of streets, etc. Those I would like to keep the casing. > I imagine it might also depend on the length > of the search string and how many similarities > there are. Ofcourse! And as such not something I would think twice about. Regards, Rudy Wieser