Professional Documents
Culture Documents
2021/2022
Luís Paquete
University of Coimbra
Experiments in computer science
Contents
Observation Hypothesis
Concrete
Prediction
Experimental
evaluation
Experiments in computer science
Falsifiability
Observation Hypothesis
Concrete
Reproducibility Prediction
Experimental
evaluation
Experiments in computer science
Quicksort
(Hoare 1959)
012345
4 5
Experiments in computer science
● Efficient accomplishment of specific tasks and towards the development of tools that
will enable classes of tasks to be accomplished more efficiently
● Practicing engineer - takes a sequence of systematic selection or design decisions
which narrow down alternative options for accomplishing the task
● Research engineer – may use mathematics and physics in the development of tools
for the practicing engineer (but more practically-oriented than a empirical scientist or a
mathematician)
Experiments in computer science
● A server needs to sort (in-place) 1GB of integers for each PageRank query
● The input data arrives almost sorted
● Server: 2 Intel Xeon Silver 4210R 2.4G, 10 Cores / 20 Threads, 9.6GT/s, 13.75M
Cache, 2 32GB RDIMM, 2933MT/s, 2 480 GB SSD SATA, OS Debian GNU/Linux 10
● Quicksort or merge sort?
● void qsort(void *base, size_t nitems, size_t size, int (*comp)
(const void *, const void*)) or std::sort() ?
● Java.utils.Arrays.sort() or Java.utils.Collection.sort()?
Experiments in computer science
Engineering cycle
System
Idea
design
Concrete
implementation
Experimental
evaluation
Experiments in computer science
System
Idea
design
Concrete
Reproducibility implementation
Experimental
evaluation
Experiments in computer science
Goals in computer science as an engineering discipline:
● Measurements: it provides the most reliable results since, given the necessary
measurement tools, no simplifying assumptions are required. However, direct
measurement may not be feasible for some systems.
● Simulation: a program that models important features of the system being analysed.
It can be easily modified to test different scenarios. It requires simplifying assumptions
since it may be impossible to model every detail of the system being studied, which
results in less accuracy.
● Analytical modeling: mathematical description of the system. It provides quick
insight into the overall behaviour of a system or its components. It may require even
more simplifying assumptions in order to be tractable.
Experiments in computer science
● Linearity: the value of the metric should be proportional to the actual performance of
the system being measured.
● Reliability: a metric is reliable if system A always outperforms system B when the
corresponding values of the metric for both systems indicate that system A should
outperform system B.
● Repeatibility: a metric is repeatable if the same value of the metric is measured
each time the same experiment is performed.
● Easiness of measurement
● Consistency: a consistent metric is one which the units of the metric and its precise
definition are the same across different systems
● Independence: a metric should be independent of outside influences
Experiments in computer science
Nondeterministic measurements
● Measurements of the same system may vary significantly due to random events.
● Exmple: CPU-time of a program may be interfered by background operating systems
tasks, page and cache mappings, system load, etc. Therefore, program’s executation
time is nondeterministic.
● A way of dealing with nondeterministic metrics is to repeat the measurements
several times and report a value that summarizes the values collected (indice of
central tendency) and other that indicates how dispersed they are (variability).
Experiments in computer science
Errors in measurements
Observer effect
Assume that a single source of random error can change the value measured for
x by +E or –E with equal probability
Assume that a two sources of random error can change the value measured for x
by +E or –E with equal probability
Recap:
● Computer science can be seen as a discipline that uses empirical, mathematical and
engineering paradigms
● From engineering perspective, the goals in computer science are: to compare
alternatives, to determine the impact of a feature, to perform system tuning, to identify
relative performance, to debug performance, to set expectations
● Techniques available: measurements, simulation or analytical modelling. Each one has
its own pros and cons.
● Metrics have several properties
● In case of nondeterministic measurements, take care of accuracy, precision and
resolution. Errors may affect accuracy and precision.
Experiments in computer science
Suggestions:
References: