User:RE Boss/Performance Records

From J Wiki
Jump to navigation Jump to search

This page holds performance records for different algorithms.

Records


Problem Winner
Combinations RE Boss
Gray codes Binary Gray code Roger Hui
Decimal value Gray code RE Boss
Overall RE Boss
Spiral Order
Power Set RE Boss

Ranking performances


To measure the performance of two verbs or more, the __relative execution time__ (rlt) together with the __ relative excution space__ (rls) is used.
The relative execution time (and space) is the execution time, et = 6!:2 (or space, es = 7!:2), divided by the execution time (space) of a fixed verb (or one fixed verb for rlt and another one for rls).
The ranking is done by the __relative peformance__, rlprf, the product of rlt and rls, with lowest product giving first place.

Comparable verbs (and performances)


To avoid a discussion as in Power Sets, verbs (and so their performances) are defined to be __comparable__ if (but not only if!):

1 = v0 -:&(/:~@ ;@(<@, S: 0)) v1

Computing and display

The scores are calculated by

scores=:  5 ts&> ]

and the ranking by

rnkng=: 3 : '([:(,~/:@/:@{.) [:(%<./)"1(,~*/)) &.|: y'

where y is the output of scores.

The display of the ranking can be done by

dspl=: 4 : 0
z=: ',0.2,0.2,0.2'(8!:0) y
z=: ('Place';'rlprf';'rlt';'rls'),z
 ('Verb';((<' '),&.>x)),.~z
)

NB.example:

   ('ps3';'ps4')dspl rnkng scores 'ps3 i.15';'ps4 15'
+-----+-----+----+----+-----+
|Place|rlprf|rlt |rls |Verb|
+-----+-----+----+----+-----+
|1    |8.88 |3.82|2.32| ps3 |
+-----+-----+----+----+-----+
|0    |1.00 |1.00|1.00| ps4 |
+-----+-----+----+----+-----+

Or in wiki format

wkdspl=: 3 : 0
hdr=. ;(<'||',LF),~(('||<:>'''''''), ,&'''''''')&.>{.y
hdr, ;(<'||',LF),.~,&.>/"1 ('||<:>';'||<)>';'||<)>';'||<)>';'||<:>'),."1 ":&.>}.y
)

Example:

    wkdspl('ps3';'ps4')dspl rnkng scores 'ps3 i.15';'ps4 15'
||<:>'''Place'''||<:>'''rlprf'''||<:>'''rlt'''||<:>'''rls'''||<:>'''Verb'''||
||<:>1||<)>8.88||<)>3.82||<)>2.32||<:> ps3||
||<:>0||<)>1.00||<)>1.00||<)>1.00||<:> ps4||

which looks like

Place rlprf rlt rls Verb
1 8.88 3.82 2.32 ps3
0 1.00 1.00 1.00 ps4