Author Topic: String comparison timings  (Read 4862 times)

jj2007

  • Member
  • *****
  • Posts: 10548
  • Assembler is fun ;-)
    • MasmBasic
String comparison timings
« on: March 09, 2016, 04:25:15 AM »
Can I have some timings, please? Thanks :icon14:

Code: [Select]
Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz

Case-sensitive, MB StringsDiffer
159 ms
132 ms
132 ms
141 ms
135 ms
Case-insensitive
236 ms
240 ms
244 ms
233 ms
235 ms

Case-sensitive, crt_strcmp
235 ms
234 ms
300 ms
231 ms
239 ms
Case-insensitive
507 ms
504 ms
506 ms
521 ms
512 ms

TWell

  • Member
  • ****
  • Posts: 748
Re: String comparison timings
« Reply #1 on: March 09, 2016, 04:56:51 AM »
Code: [Select]
AMD Athlon(tm) II X2 220 Processor

Case-sensitive, MB StringsDiffer
402 ms
381 ms
383 ms
381 ms
416 ms
Case-insensitive
568 ms
525 ms
480 ms
530 ms
481 ms

Case-sensitive, crt_strcmp
280 ms
325 ms
321 ms
325 ms
325 ms
Case-insensitive
831 ms
846 ms
811 ms
822 ms
842 ms
--- hit any key ---

mabdelouahab

  • Member
  • ***
  • Posts: 454
Re: String comparison timings
« Reply #2 on: March 09, 2016, 04:58:09 AM »
Quote
Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz

Case-sensitive, MB StringsDiffer
146 ms
149 ms
138 ms
142 ms
140 ms
Case-insensitive
247 ms
236 ms
243 ms
236 ms
237 ms

Case-sensitive, crt_strcmp
265 ms
258 ms
260 ms
279 ms
260 ms
Case-insensitive
466 ms
478 ms
479 ms
477 ms
486 ms
--- hit any key ---

Siekmanski

  • Member
  • *****
  • Posts: 2330
Re: String comparison timings
« Reply #3 on: March 09, 2016, 05:52:32 AM »
Code: [Select]
Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz

Case-sensitive, MB StringsDiffer
121 ms
118 ms
118 ms
113 ms
113 ms
Case-insensitive
231 ms
213 ms
208 ms
208 ms
208 ms

Case-sensitive, crt_strcmp
202 ms
198 ms
203 ms
224 ms
211 ms
Case-insensitive
388 ms
383 ms
398 ms
407 ms
383 ms
--- hit any key ---
Creative coders use backward thinking techniques as a strategy.

sinsi

  • Guest
Re: String comparison timings
« Reply #4 on: March 09, 2016, 06:45:00 AM »
Code: [Select]
Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz

Case-sensitive, MB StringsDiffer
101 ms
104 ms
104 ms
101 ms
100 ms
Case-insensitive
183 ms
183 ms
189 ms
189 ms
190 ms

Case-sensitive, crt_strcmp
176 ms
175 ms
174 ms
174 ms
174 ms
Case-insensitive
340 ms
341 ms
340 ms
339 ms
340 ms
--- hit any key ---

jj2007

  • Member
  • *****
  • Posts: 10548
  • Assembler is fun ;-)
    • MasmBasic
Re: String comparison timings
« Reply #5 on: March 09, 2016, 07:06:16 AM »
Thanks, folks :biggrin:

As usual, AMD doesn't like my code :(

Btw crt__stricmp has a problem with Umlaute: "This is a töst" != "This is a TÖst" for the CRT...

nidud

  • Member
  • *****
  • Posts: 1980
    • https://github.com/nidud/asmc
Re: String comparison timings
« Reply #6 on: March 09, 2016, 07:40:46 AM »
Btw crt__stricmp has a problem with Umlaute: "This is a töst" != "This is a TÖst" for the CRT...

The function is code page dependent.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7544
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: String comparison timings
« Reply #7 on: March 09, 2016, 10:49:15 AM »

Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz

Case-sensitive, MB StringsDiffer
112 ms
108 ms
105 ms
100 ms
100 ms
Case-insensitive
172 ms
173 ms
170 ms
169 ms
192 ms

Case-sensitive, crt_strcmp
197 ms
174 ms
174 ms
174 ms
203 ms
Case-insensitive
399 ms
399 ms
401 ms
342 ms
393 ms
--- hit any key ---
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

ognil

  • Guest
Re: String comparison timings
« Reply #8 on: March 09, 2016, 03:20:02 PM »
Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz

Case-sensitive, MB StringsDiffer
65 ms
64 ms
64 ms
64 ms
103 ms
Case-insensitive
111 ms
111 ms
111 ms
111 ms
111 ms

Case-sensitive, crt_strcmp
111 ms
112 ms
113 ms
110 ms
112 ms
Case-insensitive
246 ms
246 ms
246 ms
246 ms
246 ms
--- hit any key ---

jj2007

  • Member
  • *****
  • Posts: 10548
  • Assembler is fun ;-)
    • MasmBasic
Re: String comparison timings
« Reply #9 on: March 09, 2016, 03:46:03 PM »
The function is code page dependent.

Indeed, but why does it fail with the current codepage? The old codepages rely on or 32 even in the 8-bit zone...

Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz

Case-sensitive, MB StringsDiffer
65 ms
64 ms
64 ms

Fast machine - are you sure you need assembler?  ;)

Thanks to everybody - the new version is implemented and online.

Mikl__

  • Member
  • *****
  • Posts: 1008
Re: String comparison timings
« Reply #10 on: March 09, 2016, 08:10:48 PM »
Hi, Jochen!
Intel(R) Pentium(R) CPU G860 @ 3.00GHz

Case-sensitive, MB StringsDiffer
135 ms
143 ms
142 ms
135 ms
135 ms
Case-insensitive
253 ms
253 ms
260 ms
254 ms
255 ms

Case-sensitive, crt_strcmp
241 ms
243 ms
243 ms
241 ms
243 ms
Case-insensitive
504 ms
497 ms
505 ms
505 ms
498 ms

jj2007

  • Member
  • *****
  • Posts: 10548
  • Assembler is fun ;-)
    • MasmBasic
Re: String comparison timings
« Reply #11 on: March 09, 2016, 10:47:27 PM »
Hi, Mikl!

It's always a pleasure to beat the CRT, thanks :icon_mrgreen:

Intel(R) Pentium(R) CPU G860 @ 3.00GHz

Case-sensitive, MB StringsDiffer
135 ms
Case-insensitive
253 ms

Case-sensitive, crt_strcmp
241 ms
Case-insensitive
497 ms