Help / Release / J 6.01 / f//. and f//.@(g/) Improved
< Help
Jump to navigation
Jump to search
>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release
f//. and f//.@(g/) Improved |
initial writing: 2005-10-18 |
The monad f//. and the dyad f//.@(g/) are now implemented using special code for certain combinations of datatypes and rank-0 verbs f and g .
+//. for all datatypes; <.//. and >.//. for all but the complex datatype; and f//. for the following f :
Boolean | +. *. = ~: < <: > >: | |
integer | 17 b. 22 b. 23 b. |
+//.@(*/) for all datatypes, and:
Boolean | ~://.@(*./) ~://.@(+./) +//.@(*./) +//.@(+./) | |
integer | 22 b.//.@(17 b./) |
The following benchmarks demonstrate the improvement:
b=: 257 263 ?@$ 2 i=: 257 263 ?@$ 1e6 d=: 257 263 ?@$ 0 bx=: 257 ?@$ 2 [ by=: 263 ?@$ 2 ix=: 257 ?@$ 1e3 [ iy=: 263 ?@$ 1e3 dx=: 257 ?@$ 0 [ dy=: 263 ?@$ 0 ts=: 6!:2 , 7!:2@] ts 'Expression'
Expression | J 6.01 | J 5.04 | Ratio | |||||||||
~://. b | 0.0000759 | 2176 | 0.08696 | 1.12156e7 | 1146 | 5154 | ||||||
+//. b | 0.0001019 | 5248 | 0.08812 | 1.12156e7 | 865 | 2137 | ||||||
+//. i | 0.0002662 | 5248 | 0.08658 | 1.12156e7 | 325 | 2137 | ||||||
>.//. i | 0.0001825 | 5248 | 0.08705 | 1.12156e7 | 477 | 2137 | ||||||
+//. d | 0.0001584 | 9344 | 0.08903 | 1.12156e7 | 562 | 1200 | ||||||
>.//. d | 0.0002768 | 9344 | 0.08848 | 1.12156e7 | 320 | 1200 | ||||||
bx ~://.@(*./) by | 0.0001151 | 2944 | 0.08788 | 1.13475e7 | 763 | 3854 | ||||||
bx +//.@( */) by | 0.0001343 | 6016 | 0.08611 | 1.13475e7 | 641 | 1886 | ||||||
ix +//.@( */) iy | 0.0003165 | 10112 | 0.08704 | 1.17416e7 | 275 | 1161 | ||||||
dx +//.@( */) dy | 0.0001345 | 10112 | 0.08883 | 1.22659e7 | 660 | 1213 |