Software Architecture Design 237
9.3.2 Evaluation and analysis of performance
To evaluate the performance of an architectural design in a particular scenario, the
information about the performances of each component and connector must be
available.
For example, consider the Keyword Frequency Vector extraction system
discussed in Chapter 8. To evaluate the performance of the architectural design in
the pipe-and-filter style on the following scenario, we must know the time required
by each processing component (i.e. the filters) to process each data element and the
time delay by the connectors (i.e. the pipes).
Scenario 8: On average, a text file to be processed by the Keyword
Frequency Vector extraction system consists of N characters. The average
length of the words is about 6 characters. Among the words, there are about
40% small words that should be removed from the frequency calculation,
and the number of different keywords is only about 1% or less of the total
number of words.
Assume that the components and connector have the following performance
parameters
1
.
The Input filter processes each character in 5 units of time.
The Delete Small Words filter takes 20 units of time to decide whether the
word should be deleted from the stream or output to the stream.
The Reduce Word to Original Form filter takes about 30 units of time to
process each word.
The Sort Words Alphabetically component uses an insert sorting
algorithm to sort the words into alphabetical order. For each word it takes
about 3 log(n) units of time to insert it into the list, where n is the length
of the list of words.
The Statistics of Frequency filter processes each word in 10 units of time.
The Sort According to Frequency also uses an insert sorting algorithm and
takes 3log(n) time units to insert a keyword-frequency pair into the
keyword frequency vector of n elements.
The Output component processes each element in 1 unit of time.
1
Notice that the parameters given in this example are for illustration of the
analysis and evaluation process only. It does not reflect the real performance of
a system.
238 Chapter 9. Scenario-Based Analysis and Evaluation
There is a delay of about 10 units of time on all pipes in the system.
the pipe-and-filter style.
Figure 9.1 Performance parameters of pipe-and-filter architecture of KFV
Assume that the input stream of characters is always ready for the Input filter.
The Input filter will then produce words on its output stream at an average rate of 6
units of time per word. The first word produced by the Input filter will be 6 units
later after the start execution of the system. The whole stream of characters will be
processed by the Input filter in about N units of time, where N is the length of the
stream, i.e. the number of characters in the document. The earliest time that the
Input filter can finish processing of N characters is therefore, N units of time after it
started computation.
The Delete Small Words filter will start 10 units of time later after the Delete
filter output the first word. That is, it will start computation after about 16 units of
time after the whole system started execution. It will then take about 20 units to
process each word. Since the processing rate of the Delete filter is slower than the
upstream (i.e. the Input filter), the input to this filter can be considered always
ready. Consequently, it will produce output on its output stream at an average rate
of 28 units per word. The earliest time that it can produce a word to its output
stream is 36 units of time after the whole system started. It will take about 20 × N/6
Delete
small words
Reduce word to
original form
Output
Sort words
alphabetically
A stream of N
characters
A stream of
A stream of N/10 words
without small words
A stream of N/10 words
in original forms
A stream of N/10 words
in alphabetical order
A stream of N/1000
word-frequency pairs
A keyword frequency
vector consists of
N/1000 elements
KFV in required
output format
Input
1u
1u
30u
20u
3lo
g
(
n
)
u
Statistics of
frequency
10u
Sort according
to frequency
3 log(n)u
10u
10u
10u 10u
10u
10u
10u

Get Software Design Methodology now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.