|
"Bartell, Aaron L. (TC)" wrote: > > Hans, > >Oh yeah, that first EVAL with the %TRIM is pretty expensive. > > In my CGI programs I use %trim() extensively, but I don't necessarily need > to do a %trim() but instead I could do a %trimr() because I just need to get > rid of the right most characters 90% of the time. How much do I gain, if > anything, by doing a %trimr() vs. a %trim()? > If the data is already left-justified, then by using a %trim, your program is a bit bigger than it needs to be and on the %trim you have to go through a bit of extra code: the loop setup and the test of the first byte. Not enough to worry about if there's a possibility of unwanted blanks at the beginning, but otherwise, using %trimr is both more precise and causes more concise code generation. %trim-heavy code would probably be improved in many ways (readability/maintainability, performance, program size) by using varying fields. Even if your input parameters are not varying, if you copy them trimmed to varying fields, the rest of your code will be simpler and faster. (It won't take many trims to make up the time for the initial copy of the fixed field to the varying field.) Barbara
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.