Help / Release / J 6.02 / u//. Improved

From J Wiki
Jump to navigation Jump to search


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



u//.

Improved

initial writing: 2007-07-31
last updated: 2007-08-01


The dyad x u//. y has been improved where u and y are one of the following combinations:

    verb u      y type
  = <. >. + +. * *. ~:  Boolean
  <. >. +   integer, floating-point
  n b. for n= 17 22 23 25  integer

There is a generalization of a similar improvement in J 5.03 which was restricted to vector right arguments. The following benchmarks demonstrate the improvement:

x1=: 2e5 ?@$ 1e1
x2=: 2e5 ?@$ 1e2
x3=: 2e5 ?@$ 1e3
x4=: 2e5 ?@$ 1e4

b=: 2e5 5 ?@$ 2
i=: 2e5 5 ?@$ 1000
d=: 0.1 * i

ts=: 6!:2 , 7!:2@]  NB. time and space
ts 'Expression'
Expression      J 6.02    J 6.01    Ratio
x1 ~://. b 0.00277323  1536 0.02164587  4457984  7.81  2902.33
x2 ~://. b 0.00276233  3520 0.02522252  4458880  9.13  1266.73
x3 ~://. b 0.00285285  19648 0.02643234  4466048  9.27  227.30
x4 ~://. b 0.00375916  148672 0.03122265  4523392  8.31  30.43
 
x1 + //. i 0.00431878  2560 0.02990644  7603840  6.92  2970.25
x2 + //. i 0.00435932  11712 0.03602225  7605632  8.26  649.39
x3 + //. i 0.00529091  167104 0.03750901  7636352  7.09  45.70
x4 + //. i 0.01718684  1328320 0.04396052  7865728  2.56  5.92
 
x1 + //. d 0.00455240  2304 0.03985561  11798400  8.75  5120.83
x2 + //. d 0.00455401  9664 0.04259895  11801984  9.35  1221.23
x3 + //. d 0.00481319  134336 0.04401794  11863424  9.15  88.31
x4 + //. d 0.01125234  1066176 0.05060965  12322176  4.50  11.56



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