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-14
last updated: 2004-10-26


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

b =: 1e6   ?@$ 2
b6=: 1e6 6 ?@$ 2
c =: a.{~ 1e6  ?@$ #a.
c2=: a.{~ 1e6 2?@$ #a.
c6=: a.{~ 1e6 6?@$ #a.
u =: u: 1e6 ?@$ 65536
i5=: 1e6 ?@$ 1e5
i6=: 1e6 ?@$ 1e6
i9=: 1e6 ?@$ 1e9
d =: 0.01*1e6 ?@$ 1e6
bx=: ":&.>?1e6$2e5

ts=: 6!:2 , 7!:2@]   NB. time and space
ts 'Expression'
Expression  J 5.03  J 5.02  Ratio
~:b  Boolean list  0.035387   1.049280e6 0.092731   9.437824e6 2.62 8.99
~:b6 Boolean table 0.264049   9.437888e6 0.335497   1.258362e7 1.27 1.33
~:c  literal list  0.036098   1.049728e6 0.103507   9.437824e6 2.87 8.99
~:c2 literal table 0.042572   1.180288e6 0.150637   9.437824e6 3.54 8.00
~:c6 literal table 0.564360   9.437888e6 0.632055   1.258362e7 1.12 1.33
~:u  Unicode  0.041507   1.180288e6 0.155156   9.437824e6 3.74 8.00
~:i5 integer list  0.089201   1.180288e6 0.240626   1.258355e7 2.7010.66
~:i6 integer list  0.182615   2.097792e6 0.361594   1.258355e7 1.98 6.00
~:i9 integer list  0.463619   9.437824e6 0.534460   1.258355e7 1.15 1.33
~:d  float list  1.315163   9.437824e6 1.407689   1.258355e7 1.07 1.33
~:bx boxed list  3.610330   9.437824e6 3.675093   1.258355e7 1.02 1.33



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