Empirical Evaluation of Algorithm Performance: Addressing Execution Time Measurement Challenges

Abstract

In this paper, we investigate the influence of various factors, such as programming language, testing environment, and input data, on the accuracy of algorithm execution measurements. To conduct this study, we used the BubbleSort algorithm as a test case and implemented it in Java, C, and x86 assembly language. We executed these implementations with various inputs and performed an empirical evaluation of the results using the ALGator system. We showed that the influence of the chosen programming language is negligible, since the Java and C implementations gave very similar results, while the assembler implementation differed only by a constant factor. Furthermore, our analysis emphasized the importance of repeating tests to obtain precise timing measurements - the more tests we do, the more accurate the measured result will be. We also discuss the impact of the input data type which can significantly affect the execution time due to the increased number of mispredictions of the branch predictor.

References

T. H. Cormen, C. E. Leiserson, R. L. Rivest,

and C. Stein. Introduction to Algorithms.

The MIT Press, 2nd edition, 2001.

T. Dobravec. Algator — an automatic algo-

rithm evaluation system. Advances in Com-

puters, 116(1):65–131, 2019.

T. Dobravec. Exact time measuring chal-

lenges. In Proceedings of the 25th Interna-

tional Multiconference Information Society,

IS MATCOS, volume I, pages 21–24, Koper,

-14 October 2022.

M. Fern ́andez. Models of Computation,

An Introduction to Computability Theory.

Springer, 2009.

D. Johnson. A theoretician’s guide to

the experimental analysis of algorithms.

DOI:10.1090/dimacs/059/11, 12 2001.

R. Kumar. Instruction Level Parallelism:

Branch Prediction and Optimization. LAP

LAMBERT Academic Publishing, 2012.

C. C. McGeoch. Experimental analysis of

algorithms. Notices of the AMS, 48(3), 2001.

B. Moret. Towards a discipline of experi-

mental algorithmics. Monograph in Discrete

Mathematics and Theoretical Computer Sci-

ence, 2001.

M. Price. Hot code is faster code - addressing

jvm warm-up. QCon, April 2016.

B. Swathi. A comparative study and analy-

sis on the performance of the algorithms. In-

ternational Journal of Computer Science and

Mobile Computing, 5(1):91–95, Januar 2016.

M. Tedre and N. Moisseinen. Experiments in

computing: A survey. The Scientific World

Journal, 2014(1):1–11, 2014.

Authors

  • Tomaž Dobravec University of Ljubljana

DOI:

https://doi.org/10.31449/inf.v48i4.4752

Downloads

Published

01/07/2025

How to Cite

Dobravec, T. (2025). Empirical Evaluation of Algorithm Performance: Addressing Execution Time Measurement Challenges. Informatica, 48(4). https://doi.org/10.31449/inf.v48i4.4752

Issue

Section

MATCOS-22