Inverted Tables Index   <<   >>


 

Explore the performance difference between working with a table and with an inverted table.

X← 0 5⍴⊂⍬
X⍪← 'Smith'  'John'    2 23 1.25
X⍪← 'Jones'  'Dakota'  1 29 0.97
X⍪← 'Chan'   'Wilson'  2 47 2.11
X⍪← 'Wilson' 'Diana'   1 23 1.25
X⍪← 'Saxon'  'Joan'    1 31 2.8
X⍪← 'Angelo' 'Roberto' 2 19 1.11

X
X← 2e5⌿X
⎕size 'X'
cmpx 'X[j;]' ⊣ j←1 2e3 3e4
cmpx '1.7>X[;4]'
 
T←(0 6⍴'') (0 7⍴'') ⍬ ⍬ ⍬
T⍪¨← 'Smith ' 'John   ' 2 23 1.25
T⍪¨← 'Jones ' 'Dakota ' 1 29 0.97
T⍪¨← 'Chan  ' 'Wilson ' 2 47 2.11
T⍪¨← 'Wilson' 'Diana  ' 1 23 1.25
T⍪¨← 'Saxon ' 'Joan   ' 1 31 2.8
T⍪¨← 'Angelo' 'Roberto' 2 19 1.11

⍪¨ T
T← 2e5⌿¨ T
⎕size 'T'
cmpx '(⊂j)∘⌷¨T' ⊣ j←1 2e3 3e4
cmpx '1.7>4⊃T'

Inverted Tables, Dyalog Conference, 2018-11-01.