Help / Release / J 6.02 / (+/%#)/. Improved

From J Wiki
Jump to navigation Jump to search


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



(+/%#)/.

Improved

initial writing: 2007-07-27
last updated: 2007-07-29


The dyad (+/%#)/. has been made more efficient. The following benchmarks demonstrate the improvement.

xi1=: 1e6 ?@$ 10000
xj1=: 1e4 * xi1
y1 =: 0.1 * 1e6 ?@$ 2e9

xi2=: 1e5 ?@$ 1000
xj2=: 1e4 * xi2
y2 =: 0.1 * 1e5 10 ?@$ 2e9

ts=: 6!:2 , 7!:2@]  NB. time and space
ts 'Expression'
Expression       J 6.02    J 6.01    Ratio
xi1 (+/%#)/. y1 0.0157986  329216 0.1443095 22900480 9.13 69.56
xj1 (+/%#)/. y1 0.1069233  12584448 0.2223472 22900480 2.08  1.82
xi2 (+/%#)/. y2 0.0074975  267776 0.0330664 10365696 4.41 38.71
xj2 (+/%#)/. y2 0.0113118  1574400 0.0373405 10365696 3.30  6.58



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