News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Instr() timings

Started by jj2007, September 22, 2015, 10:42:12 AM

Previous topic - Next topic

jj2007

Quote from: TWell on September 30, 2015, 09:31:33 PM
Can you run jj2007 test with pocrt.dll too?

Here it is. The dll must be in the same folder.

Core i5:
384     ms for Instr_(Fast, ...), fast : normal=0.625
614     ms total for InstrWord
1265    ms for CRT strstr, crt : fast=3.29
853     ms total for Pelles C
1434    ms total for Masm32


Quote from: TWell on September 30, 2015, 07:42:11 PM
For strings here.
Lots of test files too.

Nice site indeed. But it seems there has been little progress over the years. BM/Horspool is not so fast for short needles, hashing involves a lot of overhead, ...

TWell

In old XP it dont show pocrt.dll results even that dll is in same folder?
33979 lines found
Intel(R) Celeron(R) CPU          550  @ 2.00GHz
44 ms   for finding 1834866 lines containing [] using CRT strstr()
49 ms   for finding 1834866 lines containing [] using Instr_(fast, ...)
0 ms    for finding 0 lines containing [] using Masm32 InString
937 ms  for finding 1834866 lines containing [] using MB Instr_()
47 ms   for finding 1834866 lines containing [] using InstrW()

272 ms  for finding 267624 lines containing [J] using CRT strstr()
122 ms  for finding 267624 lines containing [J] using Instr_(fast, ...)
493 ms  for finding 267624 lines containing [J] using Masm32 InString
857 ms  for finding 267624 lines containing [J] using MB Instr_()
829 ms  for finding 267624 lines containing [J] using InstrW()

331 ms  for finding 151848 lines containing [Je] using CRT strstr()
121 ms  for finding 151848 lines containing [Je] using Instr_(fast, ...)
500 ms  for finding 151848 lines containing [Je] using Masm32 InString
357 ms  for finding 151848 lines containing [Je] using MB Instr_()
183 ms  for finding 151848 lines containing [Je] using InstrW()

336 ms  for finding 59886 lines containing [Jer] using CRT strstr()
132 ms  for finding 59886 lines containing [Jer] using Instr_(fast, ...)
509 ms  for finding 59886 lines containing [Jer] using Masm32 InString
375 ms  for finding 59886 lines containing [Jer] using MB Instr_()
183 ms  for finding 59886 lines containing [Jer] using InstrW()

335 ms  for finding 3942 lines containing [Jeri] using CRT strstr()
136 ms  for finding 3942 lines containing [Jeri] using Instr_(fast, ...)
532 ms  for finding 3942 lines containing [Jeri] using Masm32 InString
383 ms  for finding 3942 lines containing [Jeri] using MB Instr_()
185 ms  for finding 3942 lines containing [Jeri] using InstrW()

348 ms  for finding 3186 lines containing [Jeric] using CRT strstr()
128 ms  for finding 3186 lines containing [Jeric] using Instr_(fast, ...)
512 ms  for finding 3186 lines containing [Jeric] using Masm32 InString
385 ms  for finding 3186 lines containing [Jeric] using MB Instr_()
183 ms  for finding 3186 lines containing [Jeric] using InstrW()

688     ms for Instr_(Fast, ...), fast : normal=0.427
1610    ms total for InstrWord
1666    ms for CRT strstr, crt : fast=2.42
0       ms total for Pelles C
2546    ms total for Masm32

391     bytes for InstrJJb
382     bytes for InsJb16
-- hit any key --

jj2007

Quote from: TWell on October 01, 2015, 05:09:08 AM
In old XP it dont show pocrt.dll results even that dll is in same folder?

This is the relevant code:

  .if Exist("pocrt.dll")
      inc hasPellesC
      Dll "pocrt"
      Declare strstrP, C:2 Alias "strstr"
  .endif


Try starting the exe from the commandline. Sometimes the current folder is not the exe's folder.

TWell

According FileMon.exe and Depends.exe those don't even try to open that dll in XP.
Any another XP user to try those InstrFastArray.exe's?
Dll is in Replay #27 here

dedndave

maybe it has to do with the file being "blocked" (execution policy)
right-click on the DLL, Properties, then Unblock, then Apply

prescott w/htt
Intel(R) Pentium(R) 4 CPU 3.00GHz
55 ms   for finding 1834866 lines containing [] using CRT strstr()
60 ms   for finding 1834866 lines containing [] using Instr_(fast, ...)
54 ms   for finding 1834866 lines containing [] using PellesC strstr
0 ms    for finding 0 lines containing [] using Masm32 InString
575 ms  for finding 1834866 lines containing [] using MB Instr_()
87 ms   for finding 1834866 lines containing [] using InstrW()

276 ms  for finding 267624 lines containing [J] using CRT strstr()
163 ms  for finding 267624 lines containing [J] using Instr_(fast, ...)
285 ms  for finding 267624 lines containing [J] using PellesC strstr
491 ms  for finding 267624 lines containing [J] using Masm32 InString
542 ms  for finding 267624 lines containing [J] using MB Instr_()
509 ms  for finding 267624 lines containing [J] using InstrW()

427 ms  for finding 151848 lines containing [Je] using CRT strstr()
175 ms  for finding 151848 lines containing [Je] using Instr_(fast, ...)
293 ms  for finding 151848 lines containing [Je] using PellesC strstr
511 ms  for finding 151848 lines containing [Je] using Masm32 InString
470 ms  for finding 151848 lines containing [Je] using MB Instr_()
243 ms  for finding 151848 lines containing [Je] using InstrW()

432 ms  for finding 59886 lines containing [Jer] using CRT strstr()
178 ms  for finding 59886 lines containing [Jer] using Instr_(fast, ...)
304 ms  for finding 59886 lines containing [Jer] using PellesC strstr
520 ms  for finding 59886 lines containing [Jer] using Masm32 InString
484 ms  for finding 59886 lines containing [Jer] using MB Instr_()
254 ms  for finding 59886 lines containing [Jer] using InstrW()

454 ms  for finding 3942 lines containing [Jeri] using CRT strstr()
179 ms  for finding 3942 lines containing [Jeri] using Instr_(fast, ...)
324 ms  for finding 3942 lines containing [Jeri] using PellesC strstr
532 ms  for finding 3942 lines containing [Jeri] using Masm32 InString
499 ms  for finding 3942 lines containing [Jeri] using MB Instr_()
256 ms  for finding 3942 lines containing [Jeri] using InstrW()

439 ms  for finding 3186 lines containing [Jeric] using CRT strstr()
183 ms  for finding 3186 lines containing [Jeric] using Instr_(fast, ...)
315 ms  for finding 3186 lines containing [Jeric] using PellesC strstr
518 ms  for finding 3186 lines containing [Jeric] using Masm32 InString
504 ms  for finding 3186 lines containing [Jeric] using MB Instr_()
255 ms  for finding 3186 lines containing [Jeric] using InstrW()

938     ms for Instr_(Fast, ...), fast : normal=0.585
1604    ms total for InstrWord
2083    ms for CRT strstr, crt : fast=2.22
1575    ms total for Pelles C
2572    ms total for Masm32

dedndave

there's a little trick to that....

unblock the zip file before unzipping it
then, all the unzipped files are unblocked   :P