1. Domácí úkol: Porovnání
Toto porovnání není finální, jde o odevzdání po měkkém deadline.
using DataFrames, CSV, PyPlot
** (process:8161): WARNING **: 14:10:24.419: Failed to load shared library 'libgtk-4.so.1' referenced by the typelib: /usr/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/../lib/libicuuc.so.72)
Import naměřených dat.
data = CSV.read("files/benchmark01.csv", DataFrame);
data[!, :score] = zeros(Int64, nrow(data));
Čas v původních datech je měřen v nanosekundách, paměť v bytech.
Každá hodnota je medián několika běhů benchmarku z balíčku BechmarkTools.jl
.
Všechny výpočty běží na stejných předem vygenerovaných polynomech.
Komentář k jednotlivých sloupců je v příslušné sekci níže.
data = coalesce.(data, 1e10)
Row | username | multi_time | multi_mem | add_time | add_mem | div_time | div_mem | eval_time | eval_mem | score |
---|---|---|---|---|---|---|---|---|---|---|
String15 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Int64 | |
1 | kalvotom | 1.1556e6 | 12160.0 | 6635.79 | 12288.0 | 55909.0 | 12336.0 | 1289.1 | 0.0 | 0 |
2 | Zuhgan | 1.10953e6 | 12160.0 | 4444.88 | 8464.0 | 427382.0 | 12624.0 | 720.19 | 0.0 | 0 |
3 | Yargug | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 0 |
4 | Seakgu | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 0 |
5 | Shum | 1.22777e6 | 12192.0 | 8767.9 | 20608.0 | 5.24856e5 | 16496.0 | 722.333 | 0.0 | 0 |
6 | Parfu | 1.15415e6 | 12160.0 | 13552.5 | 22432.0 | 1.88549e8 | 2.49252e7 | 1436.7 | 0.0 | 0 |
7 | Quordud | 1.15525e6 | 12160.0 | 6218.86 | 8608.0 | 1.73204e8 | 9.54898e6 | 1295.7 | 0.0 | 0 |
8 | Borkul | 129986.0 | 12160.0 | 6096.44 | 8128.0 | 2.419e7 | 1.27857e7 | 1201.6 | 0.0 | 0 |
9 | Jogug | 9.48704e5 | 12160.0 | 3384.11 | 8128.0 | 3.42316e6 | 7.01357e6 | 623.306 | 0.0 | 0 |
10 | Guarg | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 0 |
11 | Wauktug | 1.18684e6 | 12160.0 | 4335.38 | 8128.0 | 6.48217e6 | 1.39189e7 | 723.027 | 0.0 | 0 |
12 | Ugghra | 1.27664e5 | 12160.0 | 3372.67 | 8128.0 | 2.53291e7 | 1.39273e7 | 13162.0 | 0.0 | 0 |
13 | Gilaktug | 924454.0 | 12160.0 | 2695.67 | 8128.0 | 3.97884e6 | 1.04558e7 | 669.952 | 0.0 | 0 |
14 | Xomkug | 1.13687e6 | 12160.0 | 620.225 | 0.0 | 71018.0 | 12336.0 | 1198.9 | 0.0 | 0 |
15 | Xunaakt | 2.04755e7 | 5.64059e7 | 9222.17 | 21184.0 | 6.44727e9 | 2.82093e9 | 19998.0 | 0.0 | 0 |
16 | Saghig | 1.15524e6 | 12160.0 | 4609.94 | 8464.0 | 254894.0 | 12672.0 | 697.203 | 0.0 | 0 |
17 | Zahgorim | 821738.0 | 12160.0 | 3860.22 | 8464.0 | 100349.0 | 12624.0 | 721.922 | 0.0 | 0 |
18 | Saraugug | 3.48882e7 | 2.88922e7 | 7554.83 | 20416.0 | 3.1457e6 | 6.27283e6 | 721.247 | 0.0 | 0 |
19 | Xig | 876879.0 | 12192.0 | 4595.57 | 8160.0 | 4.39854e5 | 16832.0 | 1292.0 | 0.0 | 0 |
20 | Epkagut | 1.16356e6 | 12160.0 | 4230.28 | 8128.0 | 1.42546e8 | 1.17047e7 | 22160.0 | 0.0 | 0 |
21 | Magub | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 1.0e10 | 0 |
22 | Bugharz | 1.14116e6 | 12160.0 | 2566.7 | 9414.0 | 1.4849e8 | 1.15893e7 | 1380.3 | 0.0 | 0 |
23 | Zulgha | 6.07996e6 | 1.24922e7 | 3885.5 | 8128.0 | 1.93428e9 | 3.15093e9 | 1292.5 | 0.0 | 0 |
Poznámky
- Vedle studentů je v tabulce i můj řádek (
kalvotom
). - Pro lepší porovnání časů provedem vždy relativní porovnání s nejrychlejším časem. Měníme proto hodnoty a význam časových sloupců!
Float64
koeficienty
Násobení polynomů s Konkrétně násobíme polynomy stupně 1000 a 500 s koeficienty mezi -2 a 2.
data[!, :multi_time] /= minimum(data.multi_time);
sort!(data, [:multi_time]);
for k in axes(data, 1)
data[k, :score] += k
end
data[:, Cols(:username, :multi_time, :multi_mem, :score)]
Row | username | multi_time | multi_mem | score |
---|---|---|---|---|
String15 | Float64 | Float64 | Int64 | |
1 | Ugghra | 1.0 | 12160.0 | 1 |
2 | Borkul | 1.01818 | 12160.0 | 2 |
3 | Zahgorim | 6.4367 | 12160.0 | 3 |
4 | Xig | 6.86862 | 12192.0 | 4 |
5 | Gilaktug | 7.24128 | 12160.0 | 5 |
6 | Jogug | 7.43123 | 12160.0 | 6 |
7 | Zuhgan | 8.69099 | 12160.0 | 7 |
8 | Xomkug | 8.90514 | 12160.0 | 8 |
9 | Bugharz | 8.93872 | 12160.0 | 9 |
10 | Parfu | 9.04048 | 12160.0 | 10 |
11 | Saghig | 9.049 | 12160.0 | 11 |
12 | Quordud | 9.04914 | 12160.0 | 12 |
13 | kalvotom | 9.05182 | 12160.0 | 13 |
14 | Epkagut | 9.11423 | 12160.0 | 14 |
15 | Wauktug | 9.29659 | 12160.0 | 15 |
16 | Shum | 9.61713 | 12192.0 | 16 |
17 | Zulgha | 47.6245 | 1.24922e7 | 17 |
18 | Xunaakt | 160.385 | 5.64059e7 | 18 |
19 | Saraugug | 273.28 | 2.88922e7 | 19 |
20 | Yargug | 78330.3 | 1.0e10 | 20 |
21 | Seakgu | 78330.3 | 1.0e10 | 21 |
22 | Guarg | 78330.3 | 1.0e10 | 22 |
23 | Magub | 78330.3 | 1.0e10 | 23 |
Relativní porovnání rychlosti běhu vzhledem k nejrychlejšímu řešení.
plt.grid()
bar(axes(data.multi_time[1:19], 1), data.multi_time[1:19], tick_label=data.username[1:19])
plt.xticks(rotation=80);
Odhad alokace paměti (v bytech).
plt.grid()
bar(axes(data.multi_mem[1:19], 1), data.multi_mem[1:19], tick_label=data.username[1:19])
plt.xticks(rotation=80);
Float64
koeficienty
Sčítání polynomů s Opět polynomy stupně 1000 a 500 s koeficienty mezi -2 a 2.
data[!, :add_time] /= minimum(data.add_time);
sort!(data, [:add_time]);
for k in axes(data, 1)
data[k, :score] += k
end
data[:, Cols(:username, :add_time, :add_mem, :score)]
Row | username | add_time | add_mem | score |
---|---|---|---|---|
String15 | Float64 | Float64 | Int64 | |
1 | Xomkug | 1.0 | 0.0 | 9 |
2 | Bugharz | 4.13834 | 9414.0 | 11 |
3 | Gilaktug | 4.34627 | 8128.0 | 8 |
4 | Ugghra | 5.43781 | 8128.0 | 5 |
5 | Jogug | 5.45627 | 8128.0 | 11 |
6 | Zahgorim | 6.22391 | 8464.0 | 9 |
7 | Zulgha | 6.26466 | 8128.0 | 24 |
8 | Epkagut | 6.82056 | 8128.0 | 22 |
9 | Wauktug | 6.99001 | 8128.0 | 24 |
10 | Zuhgan | 7.16656 | 8464.0 | 17 |
11 | Xig | 7.40953 | 8160.0 | 15 |
12 | Saghig | 7.43269 | 8464.0 | 23 |
13 | Borkul | 9.8294 | 8128.0 | 15 |
14 | Quordud | 10.0268 | 8608.0 | 26 |
15 | kalvotom | 10.699 | 12288.0 | 28 |
16 | Saraugug | 12.1808 | 20416.0 | 35 |
17 | Shum | 14.1366 | 20608.0 | 33 |
18 | Xunaakt | 14.8691 | 21184.0 | 36 |
19 | Parfu | 21.851 | 22432.0 | 29 |
20 | Yargug | 1.61232e7 | 1.0e10 | 40 |
21 | Seakgu | 1.61232e7 | 1.0e10 | 42 |
22 | Guarg | 1.61232e7 | 1.0e10 | 44 |
23 | Magub | 1.61232e7 | 1.0e10 | 46 |
Relativní porovnání rychlosti běhu vzhledem k nejrychlejšímu řešení.
plt.grid()
bar(axes(data.add_time[1:19], 1), data.add_time[1:19], tick_label=data.username[1:19])
plt.xticks(rotation=80);
Odhad alokace paměti (v bytech).
plt.grid()
bar(axes(data.add_mem[1:19], 1), data.add_mem[1:19], tick_label=data.username[1:19])
plt.xticks(rotation=80);
Float64
Dělení polynomu polynomem s koeficienty Opět dělení polynomu stupně 1000 polynomem stupně 500, koeficienty mezi -2 a 2.
data[!, :div_time] /= minimum(data.div_time);
sort!(data, [:div_time]);
for k in axes(data, 1)
data[k, :score] += k
end
data[:, Cols(:username, :div_time, :div_mem, :score)]
Row | username | div_time | div_mem | score |
---|---|---|---|---|
String15 | Float64 | Float64 | Int64 | |
1 | kalvotom | 1.0 | 12336.0 | 29 |
2 | Xomkug | 1.27024 | 12336.0 | 11 |
3 | Zahgorim | 1.79486 | 12624.0 | 12 |
4 | Saghig | 4.55909 | 12672.0 | 27 |
5 | Zuhgan | 7.64424 | 12624.0 | 22 |
6 | Xig | 7.86731 | 16832.0 | 21 |
7 | Shum | 9.38767 | 16496.0 | 40 |
8 | Saraugug | 56.2647 | 6.27283e6 | 43 |
9 | Jogug | 61.2273 | 7.01357e6 | 20 |
10 | Gilaktug | 71.1663 | 1.04558e7 | 18 |
11 | Wauktug | 115.941 | 1.39189e7 | 35 |
12 | Borkul | 432.668 | 1.27857e7 | 27 |
13 | Ugghra | 453.042 | 1.39273e7 | 18 |
14 | Epkagut | 2549.6 | 1.17047e7 | 36 |
15 | Bugharz | 2655.92 | 1.15893e7 | 26 |
16 | Quordud | 3097.97 | 9.54898e6 | 42 |
17 | Parfu | 3372.42 | 2.49252e7 | 46 |
18 | Zulgha | 34597.0 | 3.15093e9 | 42 |
19 | Xunaakt | 1.15317e5 | 2.82093e9 | 55 |
20 | Yargug | 1.78862e5 | 1.0e10 | 60 |
21 | Seakgu | 1.78862e5 | 1.0e10 | 63 |
22 | Guarg | 1.78862e5 | 1.0e10 | 66 |
23 | Magub | 1.78862e5 | 1.0e10 | 69 |
Relativní porovnání rychlosti běhu vzhledem k nejrychlejšímu řešení.
plt.grid()
bar(axes(data.div_time[1:18], 1), data.div_time[1:18], tick_label=data.username[1:18])
plt.xticks(rotation=80);
Odhad alokace paměti (v bytech).
plt.grid()
bar(axes(data.div_mem[1:18], 1), data.div_mem[1:18], tick_label=data.username[1:18])
plt.xticks(rotation=80);
Float64
koeficienty
Výpočet funkční hodnoty polynomy s Polynom stupně 500 s koeficienty mezi -2 a 2.
data[!, :eval_time] /= minimum(data.eval_time);
sort!(data, [:eval_time]);
for k in axes(data, 1)
data[k, :score] += k
end
data[:, Cols(:username, :eval_time, :eval_mem, :score)]
Row | username | eval_time | eval_mem | score |
---|---|---|---|---|
String15 | Float64 | Float64 | Int64 | |
1 | Jogug | 1.0 | 0.0 | 21 |
2 | Gilaktug | 1.07484 | 0.0 | 20 |
3 | Saghig | 1.11856 | 0.0 | 30 |
4 | Zuhgan | 1.15543 | 0.0 | 26 |
5 | Saraugug | 1.15713 | 0.0 | 48 |
6 | Zahgorim | 1.15821 | 0.0 | 18 |
7 | Shum | 1.15887 | 0.0 | 47 |
8 | Wauktug | 1.15999 | 0.0 | 43 |
9 | Xomkug | 1.92345 | 0.0 | 20 |
10 | Borkul | 1.92778 | 0.0 | 37 |
11 | kalvotom | 2.06817 | 0.0 | 40 |
12 | Xig | 2.07282 | 0.0 | 33 |
13 | Zulgha | 2.07362 | 0.0 | 55 |
14 | Quordud | 2.07875 | 0.0 | 56 |
15 | Bugharz | 2.21448 | 0.0 | 41 |
16 | Parfu | 2.30497 | 0.0 | 62 |
17 | Ugghra | 21.1164 | 0.0 | 35 |
18 | Xunaakt | 32.0838 | 0.0 | 73 |
19 | Epkagut | 35.5524 | 0.0 | 55 |
20 | Yargug | 1.60435e7 | 1.0e10 | 80 |
21 | Seakgu | 1.60435e7 | 1.0e10 | 84 |
22 | Guarg | 1.60435e7 | 1.0e10 | 88 |
23 | Magub | 1.60435e7 | 1.0e10 | 92 |
plt.grid()
bar(axes(data.eval_time[1:18], 1), data.eval_time[1:18], tick_label=data.username[1:18])
plt.xticks(rotation=80);
plt.grid()
bar(axes(data.eval_mem[1:18], 1), data.eval_mem[1:18], tick_label=data.username[1:18])
plt.xticks(rotation=80);
Skóre (čím menší hodnota, tím lépe)
sort!(data, :score)
data[:, :points] = zeros(Int64, nrow(data))
n = 0
for k in axes(data, 1)
# kalvotom se nepočíta, zbývá 13 studentů
if data[k, :username] == "kalvotom"
continue
end
data[k, :points] = 5 - div(n, 4)
n += 1
end
data[:, Cols(:username, :score, :points)]
Row | username | score | points |
---|---|---|---|
String15 | Int64 | Int64 | |
1 | Zahgorim | 18 | 5 |
2 | Gilaktug | 20 | 5 |
3 | Xomkug | 20 | 5 |
4 | Jogug | 21 | 5 |
5 | Zuhgan | 26 | 4 |
6 | Saghig | 30 | 4 |
7 | Xig | 33 | 4 |
8 | Ugghra | 35 | 4 |
9 | Borkul | 37 | 3 |
10 | kalvotom | 40 | 0 |
11 | Bugharz | 41 | 3 |
12 | Wauktug | 43 | 3 |
13 | Shum | 47 | 3 |
14 | Saraugug | 48 | 2 |
15 | Zulgha | 55 | 2 |
16 | Epkagut | 55 | 2 |
17 | Quordud | 56 | 2 |
18 | Parfu | 62 | 1 |
19 | Xunaakt | 73 | 1 |
20 | Yargug | 80 | 1 |
21 | Seakgu | 84 | 1 |
22 | Guarg | 88 | 0 |
23 | Magub | 92 | 0 |