Talk:Ordered words: Difference between revisions

Line 176:
 
Now, in this day and age of fast computers, some people don't care about speed that much. I have two REXX applications, one that processes over 708,000 records (actually, words in an English word list which needs to be uppercased while doing a search), and that amount of invocations addes up. Another application reads over 58 million records, and one can see that inefficient subroutines can really slow up the works. I'd like to think that Rosetta Code is a place to show well-written routines that are applicable to any size/amount of use; one can never know where people will use such a routine (or the scale of use). A REXX ''procedure'' has to build an environment which has its own NUMERIC DIGITS, FORM, and FUZZ, its own timing (elapsed and resetted timers), local REXX variables (RC, SIGL, RESULT), and whatnot. In the above case, one local variable ('''a''') also has to be DROPed. There is always something to be paid (as far as overhead). Once the '''uppercase''' becomes a one-liner, then it becomes available to be used as an in-line algorithm, bypassing the overhead of calling a subroutine (whether a procedure or not). If anyone wants to see the benchmark REXX program, I can post it here. -- [[User:Gerard Schildberger|Gerard Schildberger]] 02:04, 16 July 2012 (UTC)
 
Then how about
<lang rexx>
uppercase:
return translate(changestr("ß",translate(arg(1),'ÄÖÜ',"äöü"),'SS'))
/**********************************************************************
a=translate(arg(1),'ÄÖÜ',"äöü") /* translate lowercase umlaute */
a=changestr("ß",a,'SS') /* replace ß with SS */
return translate(a) /* translate lowercase letters */
**********************************************************************/
</lang>
As for me, I like to program for people with a limited line length.
:now I see what you mean by your recurring elimination of dead code
which is actually avoiding empty lines created by the formatter and
makes copy/paste harder for me.
:And finally, can you provide your benchmark results for the strict comparison?
::--[[User:Walterpachl|Walterpachl]] 06:11, 16 July 2012 (UTC)
2,294

edits