Help / Release / J 5.03 / -. Improved

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



-. Improved

initial writing: 2004-01-15
last updated: 2004-10-26


The dyad -. is now faster and leaner (as are other members of the i. family of facilities). The following benchmarks demonstrate the improvement.

xb6=: 1e6 6 ?@$ 2       [ yb6=: 5e5 6 ?@$ 2
xc2=: a.{~ 1e6 2?@$ #a. [ yc2=: a.{~ 5e5 2?@$ #a.
xc6=: a.{~ 1e6 6?@$ #a. [ yc6=: a.{~ 5e5 6?@$ #a.
xu=: u: 1e6 ?@$ 65536   [ yu =: u: 5e5 ?@$ 65536
xi5=: 1e6 ?@$ 1e5       [ yi5=: 5e5 ?@$ 1e5
xi6=: 1e6 ?@$ 1e6       [ yi6=: 5e5 ?@$ 1e6
xi9=: 1e6 ?@$ 1e9       [ yi9=: 5e5 ?@$ 1e9
xd =: 0.01*1e6 ?@$ 1e6  [ yd =: 0.01*5e5 ?@$ 1e6
xbx=: ":&.>?1e6$2e5     [ ybx=: ":&.>?5e5$2e5

ts=: 6!:2 , 7!:2@]   NB. time and space
ts 'Expression'
Expression   J 5.03   J 5.02   Ratio
xb6-.yb6 Boolean table 0.3521663   1.258368e7 0.4023112   8.389440e6 1.14   0.67
xc2-.yc2 literal table 0.0418805   2.228928e6 0.1075153   6.294272e6 2.57   2.82
xc6-.yc6 literal table 1.0476035   1.258368e7 1.1020239   1.468083e7 1.05   1.17
xu -.yu  Unicode list  0.0427420   2.228928e6 0.1119265   6.294272e6 2.62   2.82
xi5-.yi5 integer list  0.0818177   4.326080e6 0.1701286   8.389376e6 2.08   1.94
xi6-.yi6 integer list  0.1937827   5.243584e6 0.2932518   1.048653e7 1.51   2.00
xi9-.yi9 integer list  0.5822542   8.389312e6 0.7092077   1.048653e7 1.22   1.25
xd -.yd  real list  1.1664952   1.258362e7 1.2117685   1.468083e7 1.04   1.17
xbx-.ybx boxed list  3.3086535   8.389312e6 3.4768167   8.389376e6 1.05   1.00



>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release