Author Topic: Playing  (Read 3656 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5770
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Playing
« Reply #15 on: October 24, 2017, 02:09:09 PM »
 :biggrin:

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

Result=20669358
17113   cycles for 10 * integers
Result=16585998
11101   cycles for 10 * floats
Result=16585998
10955   cycles for 10 * doubles

13384   cycles for 10 * integers
9058    cycles for 10 * floats
9044    cycles for 10 * doubles

13304   cycles for 10 * integers
9051    cycles for 10 * floats
9060    cycles for 10 * doubles

13291   cycles for 10 * integers
9043    cycles for 10 * floats
9074    cycles for 10 * doubles

97      bytes for integers
109     bytes for floats
109     bytes for doubles


--- ok ---
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

sinsi

  • Member
  • *****
  • Posts: 1066
Re: Playing
« Reply #16 on: October 24, 2017, 03:05:22 PM »
Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (SSE4)

Result=20669358
15380   cycles for 10 * integers
Result=16585998
10234   cycles for 10 * floats
Result=16585998
12027   cycles for 10 * doubles

12593   cycles for 10 * integers
8745    cycles for 10 * floats
8766    cycles for 10 * doubles

12557   cycles for 10 * integers
8739    cycles for 10 * floats
8755    cycles for 10 * doubles

12560   cycles for 10 * integers
8745    cycles for 10 * floats
8748    cycles for 10 * doubles

97      bytes for integers
109     bytes for floats
109     bytes for doubles
I can walk on water but stagger on beer.

Siekmanski

  • Member
  • *****
  • Posts: 1647
Re: Playing
« Reply #17 on: October 24, 2017, 03:20:03 PM »
Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz (SSE4)

Result=20669358
21188   cycles for 10 * integers
Result=16585998
14878   cycles for 10 * floats
Result=16585998
14538   cycles for 10 * doubles

14719   cycles for 10 * integers
10128   cycles for 10 * floats
10270   cycles for 10 * doubles

14097   cycles for 10 * integers
10136   cycles for 10 * floats
10184   cycles for 10 * doubles

14090   cycles for 10 * integers
10170   cycles for 10 * floats
10167   cycles for 10 * doubles

97      bytes for integers
109     bytes for floats
109     bytes for doubles
Creative coders use backward thinking techniques as a strategy.

six_L

  • Member
  • **
  • Posts: 141
Re: Playing
« Reply #18 on: October 24, 2017, 05:25:55 PM »
Quote
Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz (SSE4)
-19 of 20 tests valid,
Result=20669358
10368   cycles for 10 * integers
Result=16585998
10956   cycles for 10 * floats
Result=16585998
5953   cycles for 10 * doubles

8575   cycles for 10 * integers
5538   cycles for 10 * floats
5549   cycles for 10 * doubles

8505   cycles for 10 * integers
5545   cycles for 10 * floats
5553   cycles for 10 * doubles

8509   cycles for 10 * integers
5549   cycles for 10 * floats
5551   cycles for 10 * doubles

97   bytes for integers
109   bytes for floats
109   bytes for doubles


--- ok ---


AW

  • Member
  • *****
  • Posts: 1490
  • Let's Make ASM Great Again!
Re: Playing
« Reply #19 on: October 24, 2017, 11:40:05 PM »
This is from my recent notebook, actually "faster" than the i7 desktops I have here.

Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (SSE4)

Result=20669358
9641   cycles for 10 * integers
Result=16585998
6540   cycles for 10 * floats
Result=16585998
5303   cycles for 10 * doubles

8377   cycles for 10 * integers
6687   cycles for 10 * floats
4763   cycles for 10 * doubles

8067   cycles for 10 * integers
5396   cycles for 10 * floats
5027   cycles for 10 * doubles

8907   cycles for 10 * integers
5002   cycles for 10 * floats
11924   cycles for 10 * doubles

97   bytes for integers
109   bytes for floats
109   bytes for doubles


--- ok ---

jj2007

  • Member
  • *****
  • Posts: 8735
  • Assembler is fun ;-)
    • MasmBasic
Re: Playing
« Reply #20 on: October 25, 2017, 12:41:36 AM »
Thanks to everybody :icon14:

So the conclusion seems to be: don't bother with integers, doubles are much faster.

jj2007

  • Member
  • *****
  • Posts: 8735
  • Assembler is fun ;-)
    • MasmBasic
Sorting an array of doubles
« Reply #21 on: October 26, 2017, 11:44:49 AM »
Playing with an ordinary array of doubles (following a FreeBasic thread):
Code: [Select]
Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
generating 10000000 elements with MasmBasic Rand() took 188 ms
sorting took 1935 ms    (random)
sorting took 724 ms     (sorted)
sorting took 726 ms     (reversed)

top values:
999999.666120860
999999.510124329
999999.437946829
999999.430961910
999999.392312023

middle values:
485.134311021929
484.920106829768
484.847463668948
484.597403557664
484.515912832385

low values:
-999998.337589204
-999998.381827027
-999998.455401510
-999998.697079718
-999998.909886926

Source and exes attached. Does anybody know what happened to the incredibly fast table sort?

MichaelW in Table sort. Fastest sort algo I've ever come to know...:
Quote
In my tests sorting the int_list array, and reshuffling it between the sorts, the table sort was ~800 times faster than the CRT qsort, and ~250 times faster than an optimized, integer array only version of the Microsoft qsort code from the PSDK

six_L

  • Member
  • **
  • Posts: 141
Re: Playing
« Reply #22 on: October 26, 2017, 01:07:01 PM »
Quote
Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
generating 10000000 elements with MasmBasic Rand() took 164 ms
sorting took 1564 ms   (random)
sorting took 563 ms   (sorted)
sorting took 579 ms   (reversed)

top values:
999999.667983505
999999.129213396
999998.870305720
999998.722691092
999997.930601242

middle values:
102.337449790602
101.637560875778
101.326499135857
101.112294943695
101.109966637259

low values:
-999999.128747731
-999999.234918505
-999999.593477696
-999999.688006938
-999999.893829226

Siekmanski

  • Member
  • *****
  • Posts: 1647
Re: Playing
« Reply #23 on: October 26, 2017, 10:32:40 PM »
Is table sort a special case sorting algorithm for rows and columns?

Code: [Select]
Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz
generating 10000000 elements with MasmBasic Rand() took 150 ms
sorting took 1379 ms    (random)
sorting took 518 ms     (sorted)
sorting took 521 ms     (reversed)

top values:
999999.702442441
999999.508727345
999999.434221539
999999.387189749
999999.148771170

middle values:
518.907327206498
518.879853190547
518.851447852021
518.782995642787
518.665183337098

low values:
-999997.963197529
-999998.359475285
-999998.406041414
-999999.026302248
-999999.867286533
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 8735
  • Assembler is fun ;-)
    • MasmBasic
Re: Playing
« Reply #24 on: October 26, 2017, 10:40:51 PM »
Is table sort a special case sorting algorithm for rows and columns?

No idea. The exe I posted uses MasmBasic's ArraySort (a radix sort), but I wonder what kind of animal is that table sort: "the table sort was ~800 times faster than the CRT qsort" (MichaelW, a serious person as we all know).