Fast array access using Racket FFI
问题 I am trying to write OpenCV FFI in Racket and arrived at a point where arrays need to be manipulated efficiently. However, all my attempts to access arrays by using Racket FFI resulted in very inefficient code. Is there a way for fast access of C arrays using FFI? In Racket, this type of manipulation is reasonably fast, i.e.: (define a-vector (make-vector (* 640 480 3))) (time (let loop ([i (- (* 640 480 3) 1)]) (when (>= i 0) ;; invert each pixel channel-wise (vector-set! a-vector i (- 255