Certain operations on boolean arrays are faster if the 
product of key axis lengths is a multiple of the number of
bytes in a machine word.  For example:

   b=: 10000 3 32 [EMAIL PROTECTED] 2
   c=: 10000 3 31 [EMAIL PROTECTED] 2

   ts=: 6!:2 , 7!:[EMAIL PROTECTED]

   ts '+/b'
0.00534817 1792
   ts '+/c'
0.00654999 1792

   ts '+./b'
0.00549204 1280
   ts '+./c'
0.00769232 1280

In this case */}.$b is 96 and */}.$c is 93.  The former
is a multiple of the 4 (4 bytes in a machine word on
32-bit systems); the latter is not.  Therefore f/b is
faster than f/c (even though b has more elements than c).

So if you are doing data design, and it does not matter
if the boolean arrays have a few extra columns, then pad 
them appropriately.  At least, do this until the J interpreter
is smart enough to do it on its own, in some future release.



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to