Re: RDS vs Compiled?
Posted in 1997
On 6 Oct 1997, June Tong wrote: } Douglas Wilson (dgwilson@gte.net) wrote: } : I've just experienced this trying to debug compiled code. When I } : used RDS it actually went faster. I also got better error messages } : since the problem was an array index going out of bounds, and the } : compiled version does not report that sort of error (yes, it was } : bad programming that it wasn't being checked in the program, but } : that's the way it was), } } It's been a while since I wrote any 4GL, and I don't seem to have any 4GL } manuals to hand, but isn't there a -a flag that does array checking? There is, indeed a -a flag for the c4gl script which turns on array bound checking. It creates a rather bigger and slower executable, but does give your c-code programs the protection that the p-code runner gives automatically. You can set C4GLFLAGS="-a" in the environment to get this automatically. It is usually (always?) worth checking that array bounds are not the cause of a semi-random problem by compiling with this flag. It doesn't much matter how fast the code is if it is wrong! } : The compiled code might be faster in some cases, but I haven't seen } : yet where its significantly faster, since the SQL is the slowest } : part of the program, and is the same speed in both. } } I believe that RDS can be faster if you don't PREPARE your SQL statements, } because it basically prepares them for you. It does do that, more or less. } Obviously you can eliminate this advantage by PREPARE'ing your statements } yourself. I guess you can... However, if the code is to run as fast as possible under both p-code and c-code, then you should do the prepares anyway. It won't slow down the p-code program, but it will speed up the c-code. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>