Full name \
email@address

Deadline: 13.5.2026

Instructions:
* The main purpose of this assignment is to get some practice with performance analysis of non-trivial programs.
* Choose your own non-trivial program written in a mainstream statically typed language (C#, Java, or C/C++) and running on a major desktop/server platform (Windows, Linux), based on your preferences.
* You can write the report in Czech.
* Submit everything necessary to evaluate your solution (report, profiler output, screenshots, ...) in one zip file.

-----
Tasks
-----

Use some profiler available for the language and platform of your choice.

1. Run the profiler on the subject program to produce a list of functions sorted by time spent within their execution ("the flat profile").
   Include here the output for the first ~10 functions as plain text or attach screenshot.
   Use the profile to answer the following performance-related questions:

   a) In which function does your program spend most of its time (excluding children functions)?
      How much time is that?

   b) Which function is called the most times? How many times?

   c) In which function does the program spend most of its time including children functions?

   d) How much time is spent in that function only (excluding children) per a single call?

   e) Which function would you try to optimize first, and why?

In the next task, the symbol F denotes the function specified in the answer to question 1c.

2. Run the profiler on the subject program to produce a call graph.
   Include the relevant part of output as plain text or attach screenshot.
   Use the call graph to answer the following questions (if possible):

   a) From which function is the function F being called?

   b) In which child function does the function F spend most of its time?
      The symbol G denotes that child function below.

   c) How many times does the function F calls the function G?

   d) How many times is the function G called in total?

   e) Which other functions (except F) call the function G?

3. Use the profiling information to implement at least one optimization of the program source code.
   Include here the diff between the original and modified source (the command "diff -u").

4. Recompile the program after the changes done in step 3 and produce new profiling information.
   Use the profiler to create a new list of functions by time spent (the flat profile).
   How much time is now spent in the optimized functions, compared to before the optimization?


-------
Survey:
-------

We use the survey to evaluate the lectures and homework assignments.
It is completely voluntary, but useful for future tuning of the content and level of complexity.
Most questions can be answered using the scale from 1 to 10.
Write your answer just under the corresponding question.

(1) How new was the topic and content of the lecture for you? \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 - brand new, 10 - I already knew everything)


(2) Do you think that the content of this lecture was useful? \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 - useless or too trivial, 10 - very useful)


(3) How do you evaluate the level of complexity of the homework assignment? \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 - too trivial, 5-6 - just about right, 10 - too demanding or complex)


(4) How do you evaluate your prior experience with the tool in the context of the homework assignment? \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 - I already know and can use everything, 10 - I tried everything practically for the first time)


(5) How much time (in minutes) did you spend working on the homework assignment?


(6) Additional space for your own comments on the topic, lecture, and homework assignment:


