Next: ERROR CODES & MESSAGES
Up: PRIMDAT Processing of Primitive Numerical Data
Previous: CHANGES IN THIS DOCUMENT
This Appendix gives performance statistics for the PRIMDAT routines
in the form of typical execution times.
These are provided primarily to assist in the choice of routine for a
particular purpose, but they also provide a benchmark against which
alternative algorithms and future improvements can be judged.
In practice, execution times depend on many factors, such as the
particular processor being used, the number of page faults generated
and (in many cases) the routine argument values.
Consequently, great care should be exercised if comparing the figures given
here with the performance of a real application.
Nevertheless, the figures do give a good indication of the relative
efficiency of the routines, and are generally repeatable within 5 or 10 per
cent.
Users who know of more efficient algorithms are encouraged to contact the
author so that they may be tested under identical conditions and, if
appropriate, incorporated into this package.
The statistics presented here have been gathered on the Durham
MicroVAX II (DUMV1), using a program which processes a
sequence of data obtained from an input array (or arrays) and returns the
results to a separate output array.
For instance, in the case of the NUM_ADDR function, it is equivalent
to the simple loop:
DO 1 I = 1, N
A( I ) = NUM_ADDR( B( I ) , C( I ) )
1 CONTINUE
The figures given represent the CPU time used to calculate one result
(i.e. the total CPU time used by this loop divided by
N), each being the median of five separate determinations.
Note that the cost of executing the loop and of accessing the arguments and
assigning the result is included, since these overheads will typically
feature in most real applications.
The cost of page faults is not included, however.
These will usually occur when data arrays are accessed for the first time
(and subsequently if the array is large or has not been accessed for a while).
The cost of page faults is difficult to quantify, as it may be
installation-dependent and will also depend on the level of system activity
at the time.
However, as a very rough guide, page faulting on the Durham MicroVAX II
adds a broad average of around 7
s to the CPU time figure for
routines which access a single _REAL argument array and around 11
s
for routines accessing two _REAL argument arrays.
Page faults also impose a larger elapsed time overhead, so that their
effect can be substantial and can often make small apparent differences in
routine performance seem insignificant in practice.
Table:
Approximate median execution times (
s per operation) for the
VAL_ arithmetic and mathematical functions.
|
Data Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
ADD T |
100 |
82 |
94 |
78 |
89 |
76 |
89 |
77 |
95 |
83 |
89 |
76 |
97 |
85 |
SUB T |
100 |
82 |
94 |
79 |
89 |
76 |
89 |
77 |
95 |
83 |
88 |
76 |
97 |
85 |
MUL T |
102 |
83 |
95 |
79 |
93 |
81 |
94 |
82 |
99 |
88 |
92 |
79 |
101 |
91 |
DIV T |
105 |
85 |
96 |
81 |
110 |
98 |
111 |
99 |
109 |
97 |
105 |
93 |
111 |
98 |
IDV T |
151 |
134 |
139 |
122 |
103 |
91 |
98 |
85 |
103 |
90 |
94 |
82 |
105 |
94 |
PWR T |
410 |
395 |
287 |
270 |
140 |
127 |
139 |
127 |
140 |
128 |
135 |
124 |
140 |
129 |
NEG T |
51 |
44 |
48 |
42 |
47 |
48 |
47 |
48 |
59 |
57 |
48 |
48 |
52 |
51 |
SQRT T |
120 |
115 |
111 |
107 |
114 |
113 |
115 |
113 |
122 |
119 |
115 |
114 |
113 |
111 |
LOG T |
186 |
178 |
134 |
130 |
137 |
136 |
140 |
136 |
149 |
146 |
140 |
137 |
141 |
139 |
LG10 T |
194 |
190 |
141 |
137 |
146 |
143 |
146 |
143 |
157 |
154 |
146 |
143 |
149 |
147 |
EXP T |
198 |
188 |
163 |
153 |
167 |
160 |
168 |
160 |
173 |
167 |
168 |
158 |
182 |
175 |
ABS T |
53 |
47 |
48 |
42 |
49 |
48 |
54 |
55 |
45 |
41 |
49 |
50 |
43 |
43 |
NINT T |
121 |
112 |
108 |
101 |
45 |
42 |
45 |
42 |
45 |
42 |
45 |
42 |
44 |
43 |
INT T |
93 |
87 |
82 |
79 |
45 |
41 |
45 |
42 |
45 |
42 |
45 |
41 |
43 |
43 |
MAX T |
68 |
58 |
66 |
59 |
58 |
53 |
56 |
52 |
64 |
60 |
60 |
56 |
66 |
62 |
MIN T |
68 |
57 |
66 |
59 |
56 |
52 |
57 |
53 |
65 |
61 |
61 |
56 |
66 |
62 |
DIM T |
103 |
83 |
95 |
80 |
97 |
85 |
88 |
76 |
65 |
61 |
95 |
82 |
66 |
63 |
MOD T |
242 |
222 |
183 |
165 |
108 |
99 |
112 |
103 |
114 |
101 |
112 |
100 |
117 |
106 |
SIGN T |
115 |
95 |
108 |
93 |
137 |
124 |
132 |
120 |
55 |
42 |
139 |
125 |
53 |
44 |
SIN T |
258 |
247 |
196 |
186 |
|
|
|
|
|
|
|
|
|
|
SIND T |
222 |
210 |
172 |
163 |
|
|
|
|
|
|
|
|
|
|
COS T |
198 |
194 |
151 |
147 |
|
|
|
|
|
|
|
|
|
|
COSD T |
245 |
232 |
202 |
192 |
|
|
|
|
|
|
|
|
|
|
TAN T |
370 |
360 |
273 |
265 |
|
|
|
|
|
|
|
|
|
|
TAND T |
343 |
333 |
265 |
258 |
|
|
|
|
|
|
|
|
|
|
ASIN T |
255 |
248 |
206 |
202 |
|
|
|
|
|
|
|
|
|
|
ASND T |
258 |
253 |
206 |
202 |
|
|
|
|
|
|
|
|
|
|
ACOS T |
270 |
265 |
216 |
210 |
|
|
|
|
|
|
|
|
|
|
ACSD T |
273 |
270 |
218 |
212 |
|
|
|
|
|
|
|
|
|
|
ATAN T |
167 |
162 |
125 |
121 |
|
|
|
|
|
|
|
|
|
|
ATND T |
170 |
163 |
125 |
120 |
|
|
|
|
|
|
|
|
|
|
ATN2 T |
232 |
218 |
194 |
180 |
|
|
|
|
|
|
|
|
|
|
AT2D T |
235 |
222 |
192 |
178 |
|
|
|
|
|
|
|
|
|
|
SINH T |
196 |
182 |
167 |
155 |
|
|
|
|
|
|
|
|
|
|
COSH T |
255 |
238 |
212 |
198 |
|
|
|
|
|
|
|
|
|
|
TANH T |
247 |
237 |
170 |
163 |
|
|
|
|
|
|
|
|
|
|
|
|
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
|
|
BAD argument set? |
|
Table:
Approximate median execution times (
s per operation) for the
VEC_ arithmetic and mathematical routines.
|
Data Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
ADD T |
21 |
10.6 |
16.6 |
8.6 |
11.2 |
6.6 |
11.7 |
6.3 |
17.0 |
12.8 |
11.4 |
6.8 |
19.4 |
14.8 |
SUB T |
21 |
10.6 |
16.6 |
8.6 |
11.2 |
6.6 |
11.7 |
6.3 |
17.1 |
12.8 |
11.5 |
6.8 |
19.3 |
14.8 |
MUL T |
23 |
12.2 |
17.4 |
9.3 |
15.2 |
10.6 |
16.5 |
11.1 |
21 |
17.0 |
15.1 |
10.1 |
25 |
20 |
DIV T |
25 |
14.5 |
18.4 |
10.4 |
25 |
21 |
26 |
22 |
32 |
28 |
26 |
22 |
32 |
28 |
IDV T |
77 |
68 |
66 |
56 |
18.7 |
13.9 |
20 |
14.9 |
24 |
20 |
16.7 |
12.1 |
28 |
23 |
PWR T |
343 |
337 |
224 |
208 |
66 |
60 |
74 |
63 |
70 |
65 |
66 |
63 |
69 |
69 |
NEG T |
10.7 |
6.1 |
8.3 |
4.8 |
8.1 |
7.5 |
8.1 |
7.5 |
13.0 |
10.8 |
8.1 |
7.4 |
13.8 |
11.8 |
SQRT T |
78 |
72 |
72 |
67 |
78 |
73 |
77 |
74 |
76 |
74 |
80 |
74 |
76 |
77 |
LOG T |
143 |
137 |
93 |
90 |
100 |
95 |
98 |
96 |
100 |
97 |
101 |
96 |
101 |
98 |
LG10 T |
155 |
148 |
100 |
97 |
108 |
102 |
107 |
104 |
107 |
104 |
108 |
103 |
108 |
106 |
EXP T |
130 |
125 |
96 |
93 |
101 |
100 |
102 |
101 |
108 |
106 |
102 |
101 |
108 |
107 |
ABS T |
11.0 |
6.5 |
7.7 |
4.4 |
9.2 |
8.6 |
9.1 |
8.6 |
5.4 |
3.7 |
11.0 |
10.4 |
5.3 |
3.8 |
NINT T |
80 |
74 |
72 |
63 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.7 |
INT T |
53 |
48 |
47 |
43 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.8 |
5.4 |
3.8 |
MAX T |
20 |
11.8 |
14.3 |
8.3 |
9.0 |
6.2 |
8.9 |
6.3 |
15.1 |
12.6 |
11.1 |
8.5 |
17.0 |
14.4 |
MIN T |
20 |
11.6 |
14.9 |
8.5 |
9.6 |
6.5 |
9.5 |
6.5 |
15.4 |
13.4 |
11.3 |
9.1 |
17.6 |
14.8 |
DIM T |
22 |
13.8 |
16.8 |
10.6 |
12.3 |
9.3 |
12.8 |
8.8 |
15.7 |
13.2 |
13.6 |
12.1 |
17.8 |
15.0 |
MOD T |
185 |
172 |
120 |
110 |
27 |
24 |
28 |
26 |
33 |
29 |
31 |
29 |
38 |
35 |
SIGN T |
77 |
66 |
72 |
55 |
71 |
66 |
60 |
56 |
7.5 |
3.8 |
73 |
69 |
7.5 |
3.8 |
SIN T |
182 |
178 |
122 |
126 |
|
|
|
|
|
|
|
|
|
|
SIND T |
147 |
143 |
101 |
103 |
|
|
|
|
|
|
|
|
|
|
COS T |
158 |
155 |
112 |
109 |
|
|
|
|
|
|
|
|
|
|
COSD T |
170 |
165 |
130 |
133 |
|
|
|
|
|
|
|
|
|
|
TAN T |
297 |
293 |
200 |
202 |
|
|
|
|
|
|
|
|
|
|
TAND T |
267 |
263 |
192 |
198 |
|
|
|
|
|
|
|
|
|
|
ASIN T |
212 |
206 |
165 |
165 |
|
|
|
|
|
|
|
|
|
|
ASND T |
213 |
210 |
165 |
165 |
|
|
|
|
|
|
|
|
|
|
ACOS T |
225 |
222 |
173 |
172 |
|
|
|
|
|
|
|
|
|
|
ACSD T |
228 |
225 |
175 |
175 |
|
|
|
|
|
|
|
|
|
|
ATAN T |
124 |
121 |
85 |
82 |
|
|
|
|
|
|
|
|
|
|
ATND T |
129 |
124 |
85 |
82 |
|
|
|
|
|
|
|
|
|
|
ATN2 T |
192 |
178 |
150 |
134 |
|
|
|
|
|
|
|
|
|
|
AT2D T |
194 |
180 |
149 |
134 |
|
|
|
|
|
|
|
|
|
|
SINH T |
126 |
129 |
104 |
105 |
|
|
|
|
|
|
|
|
|
|
COSH T |
190 |
183 |
149 |
140 |
|
|
|
|
|
|
|
|
|
|
TANH T |
206 |
194 |
137 |
137 |
|
|
|
|
|
|
|
|
|
|
|
|
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
|
|
BAD argument set? |
|
Table:
Approximate median execution times (
s per operation) for the
NUM_ arithmetic and mathematical functions.
|
Data Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
ADD T |
8.5 |
6.4 |
4.5 |
4.4 |
10.6 |
4.0 |
12.1 |
SUB T |
8.4 |
6.5 |
4.5 |
4.4 |
10.6 |
3.9 |
12.1 |
MUL T |
10.3 |
7.2 |
8.6 |
9.2 |
14.8 |
7.4 |
17.2 |
DIV T |
12.6 |
8.4 |
18.6 |
19.2 |
25 |
18.8 |
25 |
IDV T |
65 |
55 |
11.5 |
13.2 |
17.8 |
9.2 |
21 |
PWR T |
335 |
213 |
60 |
62 |
66 |
60 |
67 |
NEG T |
5.2 |
4.4 |
3.5 |
3.5 |
9.4 |
3.1 |
10.1 |
SQRT T |
73 |
68 |
73 |
74 |
75 |
72 |
73 |
LOG T |
143 |
90 |
96 |
97 |
96 |
94 |
95 |
LG10 T |
154 |
97 |
102 |
103 |
104 |
102 |
103 |
EXP T |
122 |
92 |
97 |
98 |
102 |
93 |
100 |
ABS T |
6.6 |
4.2 |
4.4 |
4.4 |
0.6 |
5.6 |
0.3 |
NINT T |
86 |
72 |
1.1 |
0.5 |
0.5 |
0.3 |
0.3 |
INT T |
51 |
44 |
1.1 |
0.5 |
0.5 |
0.3 |
0.3 |
MAX T |
11.2 |
8.1 |
6.3 |
6.1 |
11.6 |
7.0 |
13.3 |
MIN T |
10.5 |
8.1 |
6.3 |
6.3 |
12.1 |
7.2 |
13.7 |
DIM T |
10.4 |
7.9 |
6.4 |
6.1 |
12.4 |
7.5 |
13.9 |
MOD T |
178 |
112 |
20 |
22 |
27 |
25 |
31 |
SIGN T |
74 |
72 |
73 |
69 |
18.4 |
69 |
18.4 |
SIN T |
176 |
118 |
|
|
|
|
|
SIND T |
140 |
95 |
|
|
|
|
|
COS T |
154 |
110 |
|
|
|
|
|
COSD T |
162 |
124 |
|
|
|
|
|
TAN T |
291 |
195 |
|
|
|
|
|
TAND T |
264 |
186 |
|
|
|
|
|
ASIN T |
198 |
158 |
|
|
|
|
|
ASND T |
201 |
157 |
|
|
|
|
|
ACOS T |
214 |
166 |
|
|
|
|
|
ACSD T |
218 |
167 |
|
|
|
|
|
ATAN T |
120 |
84 |
|
|
|
|
|
ATND T |
124 |
84 |
|
|
|
|
|
ATN2 T |
184 |
142 |
|
|
|
|
|
AT2D T |
185 |
140 |
|
|
|
|
|
SINH T |
127 |
98 |
|
|
|
|
|
COSH T |
180 |
140 |
|
|
|
|
|
TANH T |
210 |
130 |
|
|
|
|
|
|
Table:
Approximate median execution times (
s per operation) for the
VAL_ type conversion functions.
|
Result Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
DTO T |
35 |
45 |
83 |
72 |
86 |
73 |
87 |
75 |
92 |
79 |
88 |
75 |
97 |
86 |
RTO T |
50 |
49 |
33 |
33 |
84 |
74 |
84 |
74 |
93 |
86 |
84 |
74 |
93 |
83 |
ITO T |
49 |
51 |
49 |
44 |
33 |
33 |
80 |
71 |
87 |
79 |
79 |
72 |
87 |
79 |
WTO T |
49 |
51 |
48 |
44 |
45 |
42 |
33 |
33 |
90 |
84 |
80 |
71 |
86 |
77 |
UWTO T |
50 |
51 |
48 |
45 |
45 |
41 |
84 |
79 |
33 |
33 |
79 |
72 |
87 |
79 |
BTO T |
50 |
46 |
48 |
44 |
45 |
42 |
45 |
42 |
89 |
83 |
32 |
33 |
87 |
80 |
UBTO T |
50 |
46 |
48 |
45 |
45 |
41 |
46 |
42 |
45 |
41 |
81 |
72 |
26 |
26 |
|
|
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
|
|
BAD argument set? |
|
Table:
Approximate median execution times (
s per operation) for the
VEC_ type conversion routines.
|
Result Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
DTO T |
2.4 |
2.2 |
12.6 |
8.0 |
14.7 |
9.6 |
15.6 |
9.8 |
21 |
15.8 |
15.6 |
10.0 |
21 |
16.4 |
RTO T |
9.1 |
5.2 |
1.2 |
1.2 |
12.4 |
8.4 |
13.3 |
9.3 |
18.5 |
14.1 |
13.4 |
9.2 |
18.8 |
15.6 |
ITO T |
9.0 |
6.8 |
8.5 |
6.3 |
1.2 |
1.2 |
8.2 |
6.8 |
13.4 |
11.6 |
8.2 |
6.5 |
13.9 |
12.0 |
WTO T |
9.1 |
6.8 |
8.4 |
6.3 |
5.8 |
3.6 |
0.6 |
0.7 |
14.2 |
11.8 |
8.0 |
6.5 |
13.4 |
11.1 |
UWTO T |
9.5 |
7.3 |
9.0 |
6.6 |
5.4 |
3.2 |
8.5 |
6.6 |
0.7 |
0.6 |
8.9 |
6.3 |
14.3 |
12.6 |
BTO T |
9.1 |
6.8 |
8.5 |
6.1 |
5.8 |
3.6 |
5.8 |
3.5 |
14.2 |
11.6 |
0.4 |
0.4 |
13.6 |
11.8 |
UBTO T |
9.5 |
7.3 |
9.0 |
6.7 |
5.4 |
3.2 |
6.5 |
4.2 |
5.3 |
3.2 |
8.9 |
6.3 |
0.4 |
0.4 |
|
|
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
T |
F |
|
|
BAD argument set? |
|
Table:
Approximate median execution times (
s per operation) for the
NUM_ type conversion functions.
|
Result Type Code T |
|
|
D |
R |
I |
W |
UW |
B |
UB |
DTO T |
2.2 |
5.4 |
6.6 |
7.6 |
12.6 |
7.6 |
13.3 |
RTO T |
5.1 |
1.1 |
6.2 |
6.9 |
12.0 |
7.0 |
12.7 |
ITO T |
6.9 |
6.4 |
1.1 |
3.7 |
9.1 |
3.7 |
9.4 |
WTO T |
6.7 |
6.2 |
3.5 |
0.5 |
9.7 |
3.7 |
8.8 |
UWTO T |
7.1 |
6.7 |
3.1 |
4.0 |
0.5 |
4.1 |
9.9 |
BTO T |
6.9 |
6.1 |
3.5 |
3.5 |
9.4 |
0.3 |
9.4 |
UBTO T |
7.1 |
6.7 |
3.1 |
4.1 |
3.1 |
3.9 |
0.3 |
|
Next: ERROR CODES & MESSAGES
Up: PRIMDAT Processing of Primitive Numerical Data
Previous: CHANGES IN THIS DOCUMENT
PRIMDAT --- Processing of Primitive Numerical Data
Starlink User Note 39
R F Warren-Smith
28 February 1995
E-mail:ussc@star.rl.ac.uk
Copyright © 2009 Science and Technology Facilities Council