[racket] Efficiency of tight loops in Racket

From: Harry Spier (harryspier at hotmail.com)
Date: Thu Jan 13 17:07:20 EST 2011

Dear list members,

I am developing an OCR application.  If written in an imperative language ( C for example) it would spend most of its time traversing a 2 dimensional array. (I'm representing a black and white page of text as a rectangle of 0's and 1's).  My first idea was to prototype in Ruby and then convert to C or to develop in Ruby with C extensions, but I'm wondering if I could do the whole development in Racket.  I've seen somewhere (though I can't remember where) that Racket can be in the same order of efficiency as C .

But the crux issue is the efficiency of traversing the 2 dimensional array.  I've noticed in the Racket Guide section 18.7  "Unchecked, Unsafe Operations" where it says "For tight
loops that use these functions, avoiding checks can sometimes speed
the computation, though the benefits vary for different unchecked
functions and different contexts."

Have any list members ever compared the efficiency of nested C loops and how you would traverse a 2 dimensional array in Racket.

Thanks in advance,
Harry Spier

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110113/2d0cf37f/attachment.html>

Posted on the users mailing list.