Short principal argument
A short principal argument means we are searching a small fixed list for many targets
For example, we might want to find all the characters in a string which belong to a particular set like digits or vowels
The following times (in seconds) were all sped up using vectorised binary search, a technique inspired by Interval Index (⍸)
Expression
Data
16.0
17.0
18.0
0 25 40 50 60 75 100
⍸
vals
1e6 ints
5.3E¯4
4.4E¯4
9.9E¯5
1 ¯1 0['()'
⍳
text]
3e3 chars
3.3E¯6
2.0E¯6
1.3E¯6
dates
∊
2018e4+1015 1022∘.+0 2 4
1e4 dates
8.1E¯5
4.7E¯5
5.9E¯6