i. and i: Improved

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Release

i. and i: Improved | initial writing: 2000-00-00 last updated: 2004-10-26

The dyads`i.` and`i:` have been changed to improve their performance on arguments that have many columns that are identical in value (for example, aaaaba aaaaxa aaaa2a). Also,`i.` and`i:` previously had a bug in the handling of floating point arguments that differ only in the last few significant bits, resulting in very poor performance. This bug has now been fixed.
Timing comparisons are as follows:

       timer=: 6!:2

       c=: a.{~ ?3e4 36$#a.       NB. random literal
       d=: (?#~#c){c

       s=: a.{~?3e4 2$#a.
       t=: ($c)$'x'
       c1=: s (<a:;10 11)}t       NB. little-varying literal; same amount of data as c
       d1=: (?#~#c1){c1           NB. only cols 10,11 can differ in each row

       i=: (?3e4$65536),"0 1 i.8  NB. little-varying integers; same amount of data as c
       j=: (?#~#i){i              NB. only a few bytes can differ in each row

       x=: 1.12+ i. n             NB. FP with many different bits
       y=: 1e12+ i. n             NB. FP with only trailing bits different

Type | J 4.05 | J 4.04
random literal;`c i. d` | 0.0736780 | 0.0689725
little-varying literal;`c1 i. d1` | 0.0750378 | 1.64165
little-varying integer;`i i. j` | 0.0881493 | 159.712
FP with many different bits;`i.~x`
1000 | 0.00097554 | 0.00072160
2000 | 0.00176000 | 0.00120015
4000 | 0.00370522 | 0.00239025
8000 | 0.00740289 | 0.00485425
16000 | 0.01379169 | 0.01139474
FP with only trailing bits different;`i.~y`
1000 | 0.00084145 | 0.10794414
2000 | 0.00252267 | 0.45633776
4000 | 0.00383512 | 1.87803872
8000 | 0.00697798 | 7.62392158
16000 | 0.01491390 | 30.47773014

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Release