<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:small">>As the saying goes: "premature optimization is the root of all evil (or at least most of it) in programming" - Donald Knuth<font color="#888888"><br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">It depends on what you mean by "premature optimization". Understanding the underlying hardware and software of the system and avoiding optimization bottlenecks when you are writing your code is something I think Dr. Knuth would agree with.</font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888"><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">In the architecture of the IBM 360/370 series of computer there were four instructions that took an EBCDIC number and converted it to binary and back:<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">o EBCDIC to Binary Coded Decimal (BCD)<br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">o BCD to Binary<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">Then converting back:<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">o Binary to BCD<br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">o BCD to EBCDIC<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">Four of the most expensive operations in the system.<br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888"><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">I had a friend who wrote a subroutine one time that needed a binary index into an array. He told the COBOL programmers to pass him a number (PICTURE 99) which was passed as an EBCDIC number.<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">Too late he realized that he was forcing the system to do two very expensive, needless conversions hundreds of millions of times a day.<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">When I pointed this out to him he had his head down in his hands.<br><br></font></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:small"><font color="#888888">md<br>
</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 17, 2023 at 4:12 PM Ben Coleman via Ale <<a href="mailto:ale@ale.org">ale@ale.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/17/2023 2:20 PM, Charles Shapiro via Ale wrote:<br>
> Heh. Reminds me of the guy at one of my old gigs who spent several weeks <br>
> of coding and testing to replace all of the simple sequential loop <br>
> searches in a pretty big application with sorts + binary searches. The <br>
> original application took several hours to finish. After his <br>
> optimizations, the new version took about fifteen minutes less time. <br>
> **Always** profile before you optimize!<br>
<br>
As the saying goes: "premature optimization is the root of all evil (or <br>
at least most of it) in programming" - Donald Knuth<br>
<br>
Ben<br>
-- <br>
Ben Coleman <a href="mailto:oloryn@benshome.net" target="_blank">oloryn@benshome.net</a> | For the wise man, doing right trumps<br>
<a href="http://oloryn.benshome.net/" rel="noreferrer" target="_blank">http://oloryn.benshome.net/</a> | looking right. For the fool, looking<br>
Amateur Radio NJ8J | right trumps doing right.<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="https://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">https://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div>