Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #12330
| From | "R.Wieser" <address@not.available> |
|---|---|
| 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 | 2021-01-03 08:58 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <rsrtfa$1v8c$1@gioia.aioe.org> (permalink) |
| References | (1 earlier) <rspt2m$613$1@dont-email.me> <rsq4fr$2tr$1@gioia.aioe.org> <rsqku7$ksc$1@dont-email.me> <rsqnho$157m$2@gioia.aioe.org> <rsqs1f$5le$1@dont-email.me> |
Mayayana, > I don't know. InStr is incredibly fast. I suspect the > wrapper bloat is much of the time. Yesterday, ofcourse just after I called it a night and switched my 'puter off, I got a brainfart. Just now I tested it. You mentioned caseless searching, and that is what I have been doing (and forgot to mention, sorry). Changing that last InStr argument back to casefull searching sped the whole process up considerably. What I think that happens is that InStr() first converts both strings to either upper or lower case, and only than does the search. While that isn't a problem for relativly short strings, the conversion does take some time when you throw 25 MB at it ... ... especially when you do that in a loop which finds over 40,000 . Hence that reading the file line-by-line and than doing the caseless InStr() sped the process up. The whole process using the 25 MB string still takes several seconds to complete though. Oh well. Regards, Rudy Wieser
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
Why does a loop using instr() and mid() get slower on larger data ? "R.Wieser" <address@not.available> - 2021-01-02 12:41 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? "Mayayana" <mayayana@invalid.nospam> - 2021-01-02 08:39 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? "R.Wieser" <address@not.available> - 2021-01-02 16:46 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? "Mayayana" <mayayana@invalid.nospam> - 2021-01-02 15:26 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? "R.Wieser" <address@not.available> - 2021-01-02 22:11 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? "Mayayana" <mayayana@invalid.nospam> - 2021-01-02 17:27 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) "R.Wieser" <address@not.available> - 2021-01-03 08:58 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) "Mayayana" <mayayana@invalid.nospam> - 2021-01-03 08:54 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) "R.Wieser" <address@not.available> - 2021-01-03 16:01 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) "Mayayana" <mayayana@invalid.nospam> - 2021-01-03 12:51 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? - found it (I think) "R.Wieser" <address@not.available> - 2021-01-03 19:26 +0100
Re: Why does a loop using instr() and mid() get slower on larger data ? "Mayayana" <mayayana@invalid.nospam> - 2021-01-02 17:43 -0500
Re: Why does a loop using instr() and mid() get slower on larger data ? JJ <jj4public@gmail.com> - 2021-01-03 02:47 +0700
Re: Why does a loop using instr() and mid() get slower on larger data ? "R.Wieser" <address@not.available> - 2021-01-02 21:47 +0100
csiph-web