Yeah, it's an interesting adjustment. For those of us who began coding on 
things like 8-bit 64Mhz 16Mb boxes, optimizing code was absolutely essential. 
Now, my desktop is a 4-core 2.8Ghz (you can get an 8 core I7 laptop for under 
$700), 8Gb of RAM 64 bit machine, and it's nearly obsolete. When I code (or 
review code), I'm not so much looking to wrest out every last system call 
(although I still do it out of habit), I'm just looking to make sure there are 
no egregious errors that will affect performance (or stability, or...), like 
executing a select instead of doing an internal one. Given a minimum of 
self-created bottlenecks, disk IO is still the limiting factor, (usually) not 
CPU cycles, especially if your OS isn't bloatware. In a few short years, we'll 
have solid state disks and a new set of problems. BTW, anyone see IBM's new 
offering, Pure System? In many ways, a 180 degree turn: everything is back in 
one rack: cpu's, storage, networking... 
 > Date: Fri, 20 Apr 2012 08:27:48 -0500
> From: [email protected]
> To: [email protected]
> Subject: Re: [U2] Case Statement with only two cases
> 
> A respectful correction, Brian.
> 
> On 4/20/2012 4:50 AM, Brian Leach wrote:
> > it's all the same to the compiler.
> > -----Original Message-----
> >     BEGIN CASE
> >        CASE A = "TEST"; GOSUB DO.SOMETHING
> >        CASE 1; GOSUB DO.SOMETHING.ELSE
> >     END CASE
> > versus this
> >     IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB DO.SOMETHING.ELSE
> -----
> 
> Since we seem to be finding every nit in the bottom of this empty 
> barrel, here's one more.
> There are 2 compiler difference as shown by VLIST (UV10.2):
> 
> 00001: BEGIN CASE
> 
> 00002:    CASE A = "TEST"; GOSUB DO.SOMETHING
> 00002 00000 : 06E eq             A "TEST"  => $R0
> 00002 00008 : 2DE testfw         $R0 00020:
> 00002 00010 : 0A4 gosub          00060:
> 
> 
> 00003:    CASE 1; GOSUB DO.SOMETHING.ELSE
> 00003 00018 : 0C2 jump           00038:
> 00003 00020 : 2DE testfw         1 00038: <-------------- Extra 
> worthless test
> 00003 00028 : 0A4 gosub          00062:
> 
> 00004: END CASE
> 00004 00030 : 0C2 jump           00038: <-------------- Extra worthless 
> jump (to next line)
>                                                                            
> (Source lineup is goofy.  This jump is really part
>                                                                          
>     of source line 3.   RAID is confusing, too.
>                                                                             A 
> discussion for a different thread.)
> 
> 00005: IF A = "TEST" THEN GOSUB DO.SOMETHING ELSE GOSUB DO.SOMETHING.ELSE
> 00005 00038 : 06E eq             A "TEST"  => $R0
> 00005 00040 : 2DE testfw         $R0 00058:
> 00005 00048 : 0A4 gosub          00060:
> 00005 00050 : 0C2 jump           00060:
> 00005 00058 : 0A4 gosub          00062:
> 
> 00006: STOP
> 00006 00060 : 190 stop
> 
> 
> With the speed of today's machines it would be hard to find a place 
> where that performance makes a difference.
> 
> Rocket could theoretically clean up both (or either independently) if 
> the compiler was smart enough:
> 
> 1. to know that a logical test outcome was predestined at compile time 
> (It already does that sort of thing in other situations.).  Then it 
> could  compile only 1 of the 2 paths the testfw takes.  (e.g. 0020x).  
> Same for IF,  WHILE, or UNTIL constructs.
> 
> 2. To recognize the final CASE before the END CASE never needs to jump 
> (e.g., 0030x).
> 
> I wonder if we've already wasted more electrical & biological energy by 
> me writing this email, dispersing it around the globe, and you reading 
> it, than all the machine cycles wasted executing the 2 worthless tests 
> in all the object scattered around the universe that Rocket could 
> theoretically optimize.
> 
> cds
> 
> 
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
                                          
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to