Post Reply 
8-Queens Benchmark
09-01-2024, 06:27 PM (This post was last modified: 09-04-2024 03:58 PM by Hlib.)
Post: #37
RE: 8-Queens Benchmark
Quote:... If we now use a different test code that is a bit faster but the execution path has been significantly changed, we would have to question all the other test codes and look for better implementations to be fair. ...

I made three programs identical in structure for CASIO and TI and brought the calculation path to a single standard: 876 steps, 2205 comparisons If T=0 or X-Y=Abs(T), as is in this benchmark.
CASIO:
Code:

ClrText : 8->R : {R,1}->Dim Mat A
0->S : 0->X : 0->Z
While Z<0 Or X<>R
  If Z>=0 : Then Isz X : R->L
    Else Dsz X : Mat A[X,1]-1->L
      If X=0 : Then Break
       IfEnd
  IfEnd
  For L->Y To 1 Step -1
    For X-1->Z To 1 Step -1
    Y-Mat A[Z,1]->T
      If T=0 Or X-Z=Abs T
        Then -1->Z : Break
      IfEnd
    Next : Isz S
      If Z>=0 : Then Y->Mat A[X,1]
      Break
      IfEnd
  Next
WhileEnd : S

TI Z80:
Code:

ClrHome : 8->R : R->dim(L1)
0->S : 0->X : 0->Z
While Z<0 or X<>R
  If Z>=0 : Then : X+1->X : R->L
    Else : X-1->X
      If X=0 : Then : 1->Z : R->X : 0->L
      End
    L1(X)-1->L
  End
  For(Y,L,1,-1)
    For(Z,X-1,1,-1)
      Y-L1(Z)->T
        If T=0 or X-Z=abs(T) : -1->Z
    End : S+1->S
      If Z>=0 : Then : Y->L1(X) : 0->Y
      End
  End
End : Disp S

TI 68K:
Code:

nqueens()
prgm
ClrIO
Local a, l, r, s, t, x, y, z
8->r : 0->s : 0->x : 0->z
newList(r)->a
While z<0 or x<>r
  If z>=0 Then
  x+1->x : r->l
    Else
    x-1->x
      If x=0 : Exit
      a[x]-1->l
  EndIf
  For y, l, 1, -1
    For z, x-1, 1, -1
    y-a[z]->t
      If t=0 or x-z=abs(t) Then
      -1->z : Exit
      EndIf
    EndFor
    s+1->s
    If z>=0 Then
    y->a[x] : Exit
    EndIf
  EndFor
EndWhile
Disp s,a
EndPrgm

Here is a table with the results for several well-known old models. Perhaps this information will be of interest to someone.
Code:

22.5_s fx-9750gii(SH3)
42_s fx-9860gii(SH4)
46_s ti-83+SE
58_s ti-84+/84+SE (new HW, OS 2.55MP, classic mode)
67_s = 1:07  ti-84+ (old HW)
78_s = 1:18 ti-89 Titanium (HW3, exact mode)
103_s = 1:43 fx-2.0+, graph-100+
114_s = 1:54 ti-85 (OS ver.9.0)
119_s = 1:59 ti-83+
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
8-Queens Benchmark - Hlib - 05-23-2016, 06:08 PM
RE: 8-Queens Benchmark - xerxes - 05-24-2016, 02:28 PM
RE: 8-Queens Benchmark - Hlib - 05-27-2016, 08:14 PM
RE: 8-Queens Benchmark - Hlib - 06-25-2016, 06:39 PM
RE: 8-Queens Benchmark - xerxes - 06-26-2016, 06:47 PM
RE: 8-Queens Benchmark - mtern - 06-29-2016, 11:41 AM
RE: 8-Queens Benchmark - xerxes - 06-30-2016, 12:04 PM
RE: 8-Queens Benchmark - xerxes - 06-30-2016, 08:14 PM
RE: 8-Queens Benchmark - Accutron - 07-03-2016, 04:22 PM
RE: 8-Queens Benchmark - Accutron - 07-04-2016, 02:10 AM
RE: 8-Queens Benchmark - xerxes - 07-02-2016, 06:39 PM
RE: 8-Queens Benchmark - xerxes - 07-03-2016, 09:56 AM
RE: 8-Queens Benchmark - Accutron - 07-10-2016, 03:21 AM
RE: 8-Queens Benchmark - Egan Ford - 07-10-2016, 06:03 PM
RE: 8-Queens Benchmark - Accutron - 07-10-2016, 06:45 PM
RE: 8-Queens Benchmark - Accutron - 07-10-2016, 07:19 PM
RE: 8-Queens Benchmark - xerxes - 07-12-2016, 10:44 PM
RE: 8-Queens Benchmark - Accutron - 07-12-2016, 10:58 PM
RE: 8-Queens Benchmark - xerxes - 07-13-2016, 10:46 AM
RE: 8-Queens Benchmark - Accutron - 07-13-2016, 02:01 PM
RE: 8-Queens Benchmark - Jurgen Keller - 01-06-2017, 06:31 PM
RE: 8-Queens Benchmark - xerxes - 01-06-2017, 02:23 PM
RE: 8-Queens Benchmark - rprosperi - 01-06-2017, 04:00 PM
RE: 8-Queens Benchmark - xerxes - 01-07-2017, 06:56 PM
RE: 8-Queens Benchmark - Guenter Schink - 11-14-2021, 06:52 PM
RE: 8-Queens Benchmark - xerxes - 11-15-2021, 11:37 PM
RE: 8-Queens Benchmark - Hlib - 08-25-2024, 02:53 PM
RE: 8-Queens Benchmark - xerxes - 08-26-2024, 05:58 AM
RE: 8-Queens Benchmark - toml_12953 - 09-03-2024, 11:14 AM
RE: 8-Queens Benchmark - Hlib - 09-01-2024 06:27 PM



User(s) browsing this thread: 2 Guest(s)