EasyManuals Logo
Home>Texas Instruments>Calculator>TI-92+

Texas Instruments TI-92+ User Manual

Texas Instruments TI-92+
507 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #337 background imageLoading...
Page #337 background image
[3]
Nc
Na
=
5.7 mS
Tcv16.88 mS
For example, suppose we have a matrix with 50 rows and 3 columns. We use equation [1] to find Tcv =
191 mS, and Nc/Na = 0.033. If the function accesses only three elements (Na=3), then Nc = 0.1. Since
Nc < 1, the reference method is always faster, regardless of the number of function calls. However, if
the function accesses every matrix element (Na = 150), then Nc = 4.95. In this case, the reference
method is faster only if we call the function more than 5 times.
As another example, consider a matrix with 10 rows and 10 columns. Equation [1] gives Tcv = 117 mS,
and Nc/Na = .057. If the function accesses 10 elements, then Nc = .57, so the reference method is
always faster. However, if the function accesses all 100 matrix elements, then Nc = 5.7, so the
execution time is less for the reference method only if we call the function at least 6 times.
The general result is that the reference method may be faster if the matrix is large and few elements
are accessed.
List arguments
When lists are passed as function arguments, the call overhead can also be considerable, as this table
shows:
459.8 mS700
269.1 mS400
84.6 mS100
22 mS0
Overhead / function callNumber of list elements
Timing data for lists of 11 sizes results in this model equation, which is accurate to 1 or 2%:
T = 623.2967E-6 (N) + 0.021577 [4]
where T is the overhead per function call and N is the number of list elements. As with the case for
matrices above, we can find a function to calculate the break-even point in terms of the number of
function calls, and the number of list element accesses made by the function. It is, in fact, the same
function with different constants, that is
N
c
N
a
=
T
ar
T
av
T
cv
T
cr
where
Nc = the number of function calls
Na = the number of list element accesses in the function
Tar = time required to access an element by reference: expr(list_name&"[]")
Tav = time required to access an element by value: list[]
Tcv = time required to call the function with the list as a value argument; from [4] above
Tcr = time required to call the function with the list argument by name
Tar and Tav are functions of the size of the list, as well as which element of the list is accessed. These
functions estimate the mean execution time for a single list element:
7 - 48

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-92+ and is the answer not in the manual?

Texas Instruments TI-92+ Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-92+
CategoryCalculator
LanguageEnglish

Related product manuals