RE: link statically with libc?

I don't know how the Ada guys do it. Perhaps they have an alternate set of compiled libraries with bounds-checking turned off?
Me neither, I've just heard the idea discussed, not the actual technology.
I know O'Caml does this too (-unsafe as a compiler flag gives you unsafe array accesses). I've found in that context, I get as much as a 15% speedup over not having -unsafe. Admittedly this is on an extremely array-intensive application, but it certainly can be a win. On a related note, I know that the IBM Java compiler (I'm blanking on the name right now) gets a lot of its speedups over Sun by lifting bounds checks out of loops. That is, if you have: for (int i=0; i<1000; i++) { acc += arr[i]; } in traditional Sun javac, you get something that basically looks like: for (int i=0; i<1000; i++) { if i outside of arr bounds, throw exception acc += arr[i]; } but the IBM compiler will lift this out (under certain circumstances -- for instance, if 'acc' is not in scope of the catch) to: if 0 outside of arr bounds || 999 outside of arr bounds, throw exception for (int i=0; i<1000; i++) { // look ma, no checks acc += arr[i]; } does GHC do anything similar to this, or are we getting hit with array checks at each and every read/write (modulo, of course, full laziness)? - Hal
participants (1)
-
Hal Daume