Author Topic: Instr() timings  (Read 11461 times)

jj2007

  • Member
  • *****
  • Posts: 11449
  • Assembler is fun ;-)
    • MasmBasic
Re: Instr() timings
« Reply #30 on: September 30, 2015, 11:26:36 PM »
Can you run jj2007 test with pocrt.dll too?

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

Core i5:
Code: [Select]
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

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

  • Member
  • ****
  • Posts: 748
Re: Instr() timings
« Reply #31 on: October 01, 2015, 05:09:08 AM »
In old XP it dont show pocrt.dll results even that dll is in same folder?
Code: [Select]
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

  • Member
  • *****
  • Posts: 11449
  • Assembler is fun ;-)
    • MasmBasic
Re: Instr() timings
« Reply #32 on: October 01, 2015, 06:21:30 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

  • Member
  • ****
  • Posts: 748
Re: Instr() timings
« Reply #33 on: October 01, 2015, 02:54:03 PM »
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

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Instr() timings
« Reply #34 on: October 01, 2015, 04:04:44 PM »
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
Code: [Select]
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

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Instr() timings
« Reply #35 on: October 01, 2015, 04:09:07 PM »
there's a little trick to that....

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