2 Notion of Algorithm.docx

# Using this timing capability there are many factors

This preview shows pages 18–19. Sign up to view the full content.

Using this timing capability there are many factors of the program's performance we can check. The most important test of a program is the one which confirms the earlier analysis of the order of magnitude of the execution time . Using actual timing data we should be able to determine the exact shape of this curve given the programming language and the machine we are using. The resulted information is usually used to validate or to invalidate the results of the a priori analysis, or at list to nuance it. Let suppose an algorithm implemented in the form of a program be called Algorithm (X:Input, Y:Output) where X denotes the input and Y the output. In order to build the algorithm’s profile are necessary to be conceived: (1) The input sets whose dimension grows between certain limits, in order to study the algorithm behavior reported to the input dimension. (2) The input sets related to the worst and best possible cases. (3) A procedure which produces the timing profile of the algorithm running the inputs sets [2.5.a]. ------------------------------------------------------------ procedure Profile ; {the procedure builds the profile of the procedure Algoritm(X: Input,Y: Output)} begin * initialize procedure Algorithm; *print ("Algorithm Test. Time in msec"); repeat *read (DataSet); [2.5.a] *print ("A new data set:", DataSet); *call TIME (t); {t is assigned with the current value of the system’s clock} *call Algorithm (DataSet, Results); *call TIME(t1); *print ("Execution Time =", t - t1); until end(DataSet) end {Profile} ------------------------------------------------------------ The Profile procedure can be used for different purposes depending on the focused objectives . (1) To determine the intrinsic performance of a certain algorithm. For this, data sets with increasing dimensions are used. The resulting times denote the algorithm’s profile .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
For a plenary algorithm’s profile, the worst and best cases are also tested. (2) To determine the relative performance of two or more algorithms achieving the same task. For this, the procedure Profile is executed for each algorithm in turn, with the same data sets, on the same computing system. Comparing the resulted profiles, the performances of the analyzed algorithms can be ranked. (3) To determine the relative performance of two or more computing systems . In this case the procedure Profile is executed for the same algorithm, with the same data sets, on each of the analyzed target systems. Comparing the resulted profiles, the performances of the analyzed computing systems can be ranked . Usually on the computing systems market, for this purpose consecrated algorithms, sometime standardized, known as " bench marks ", are used to asses the performance of the computing system architectures. We need to pay a special attention to function TIME whose results, under specific circumstances are irrelevant.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern