Sharpening your APL knife

Performance

General Rules

About Data

About Each -1-

About Each -2-

If you know or assume that a particular operation might be or become a performance bottleneck:

Practise a.1

Practise b.2

  •   10 1
  •   10 3
  •   10 4
  •   11 10
  •   11 20
  • ⍝ result:
  •   10  8
  •   11 30

Practise b.1

  • ⍝ Given a boolean vector:
  • 0 0 0 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1
  • ⍝ Wanted as result:
  • 0 0 0 1 0 0 2 2 2 2 0 0 0 0 3 0 4 4

End