A follow up on Roger Hui's 2008 page for boolean performance

on a 64 bit processor amd a8-5500

```ts =: ,&'/sec '@":@%@(6!:2) , ,&'MB'@":@(%&1000000)@(7!:2)@:]

a16=. 100000 16 ?@\$ 2
b16=. 100000 15 ?@\$ 2

10000 ts'+/a16'
3401.07/sec 0.002432MB
10000 ts'+/b16'
3360.66/sec 0.002432MB

a64=. 25000 64 ?@\$ 2
b64=. 25000 63 ?@\$ 2

10000 ts'+/a64'
4479.17/sec 0.003328MB
1000 ts'+/b64'
4463.31/sec 0.003328MB

a1=. 1600000 1?@\$ 2
b1=. 1599999 1?@\$ 2
1000 ts'+/a1'
8532.76/sec 0.002176MB
1000 ts'+/b1'
8401.9/sec 0.002176MB

a=. 1600000 ?@\$ 2
b=. 1599999 ?@\$ 2
10000 ts'+/a'
9530.38/sec 0.002176MB
10000 ts'+/b'
9748.98/sec 0.002176MB```

for +/ there is still a small advantage for 64 bit aligned tables, but for the common row select operation, a one dimensional array is more common.

keep in mind that +/ gives totals by column, and so the 64 bit aligned data results in 64 totals. 1 long total is only about twice as fast as 64 smaller totals. All seem extremely fast.

For selection,

```   i=. i. 1600000
100 ts 'a # i'
70.2397/sec 8.39002MB
10 ts 'a64 (17 b.) 25000 64 \$i'
31.7603/sec 50.334MB

100 ts 'i { i'
91.3701/sec 16.7786MB
5 ts 's=: ((-: = <.@-:) # ])  i'
2.44016/sec 35.6541MB
20 ts 's { i'
140.258/sec 8.39002MB

i =. i.1599999

100 ts 'b # i'
70.3346/sec 8.39002MB
10 ts 'b64 (17 b.) 25000 63 \$i'
28.6121/sec 50.334MB

5 ts 's=: ((-: = <.@-:) # ])  i'
2.6364/sec 35.6541MB
20 ts 's { i'
141.024/sec 8.39002MB```

No apparent difference for selection purposes

Where there is a big difference:

```   100 ts '=/ a16'
2538.09/sec 0.002176MB
100 ts '=/ a64'
3758.76/sec 0.002304MB
100 ts '=/ b64'
2017.52/sec 0.002304MB
100 ts '=/ b16'
696.405/sec 0.002176MB```

PascalJasmin/update on boolean performance (last edited 2013-09-14 22:09:20 by PascalJasmin)