Exercise 17 Index   <<   >>


  Run some benchmarks comparing x⍳y and (,⊂x)(8⌶)(,⊂y) .


























   )load dfns

   x←⎕nl 3
   ⍴x
197 12
   y←(⍴x)⍴x

   cmpx 'x⍳y' 'x⍳x' '(,⊂x)(8⌶)(,⊂y)' '8⌶⍨,⊂x'
x⍳y            → 2.0e¯5 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
x⍳x            → 2.0e¯5 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
(,⊂x)(8⌶)(,⊂y) → 8.8e¯6 | -56% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
8⌶⍨,⊂x         → 3.8e¯6 | -81% ⎕⎕⎕⎕