[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Some LET timings
I used to avoid move, add, subtract, etc. because they seemed like relics of
COBOL, and I am a relic of FORTRAN, BASIC, and C. When I heard they were
faster, I adopted them for limited use; incrementing a loop counter or
summing a total. As people have noted, it would be a rare database
application in which the performance of these commands outweighed the
performance of the SQL functions. I'm more concerned about maintaining the
code than accelerating the arithmetic.
People who are familiar with it have no problem, I'm sure, but I still
hesitate when reading "divide #x into #y." Tell me again, which variable
stays the same and which variable has a new value? Is the new value "#x/#y"
or "#y/#x?" Of course I know the answers - by mentally translating the
statement into "let #y = #y / #x."
There's also the problem of changing the formula. It's not hard to change
from "let #x = #y" to "let #x = #y * 1.05," but the same change to a move
command means adding an additional (multiply) command. And as soon as we
want to use an array value or a built-in function, we have to switch to the
"let" command.
But most of all, these commands can make variable names a lie. We might
write "let #average = #total / #count" truthfully, but if we write "divide
#count into #total," then #total is no longer a total, it is misnamed.
Similarly "multiply 1.05 times #salary" gives someone a 5% raise, but it
uses the same variable, #salary, for what should be #starting_salary and
#ending_salary.
In summary, the half second savings for every hundred thousand operations
may be lost in a single late night debugging session.
-----Original Message-----
From: Peter Burton [mailto:pburton@brio.com]
Sent: Wednesday, July 30, 2003 9:15 AM
To: 'sqr-users@sqrug.org'
Subject: [sqr-users] Some LET timings
All,
Values adjusted 0.182940 seconds for looping (100,000) overhead.
1.337228 seconds to do LET commands.
0.927615 seconds to do MOVE (STRING) commands.
=====
0.669077 seconds to do LET commands.
0.475877 seconds to do MOVE (FLOAT) commands.
=====
1.218661 seconds to do LET commands.
0.392715 seconds to do ADD commands.
=====
1.213833 seconds to do LET commands.
0.403296 seconds to do SUBTRACT commands.
=====
1.156984 seconds to do LET commands.
0.470526 seconds to do MULTIPLY commands.
=====
1.180882 seconds to do LET commands.
0.595128 seconds to do DIVIDE commands.
Peter
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users