f. Improved |
initial writing: 2003-07-14 last updated: 2004-10-26 |
f. has been improved so that v f. would exploit
the special code that would be exploited by a completely primitive version of v ;
the execution of x v f. y (and v f. y) would
be as fast and as lean as a completely primitive version of v . For example:
ts=: 6!:2 , 7!:2@] NB. time and space tally =: # rev=: |. x=: 100000 $ i. 6 y=: i. 100000 10 ts 'Expression'
Expression | J 5.03 | J 5.02 | Ratio | ||||||
x #/. y | 0.0114327 | 1.57370e6 | 0.0114442 | 1.57370e6 | |||||
x tally/. y | 0.114467 | 1.32402e7 | 0.115316 | 1.32402e7 | |||||
x tally/.f. y | 0.0117163 | 1.57414e6 | 0.0763963 | 6.94848e6 | 6.52 | 4.41 | |||
|."1 y | 0.0383105 | 4.19520e6 | 0.0383065 | 4.19520e6 | |||||
rev"1 y | 0.193694 | 4.19578e6 | 0.183509 | 4.19578e6 | |||||
rev"1 f. y | 0.0380708 | 4.19558e6 | 0.0994439 | 4.19603e6 | 2.61 | 1.00 |