-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
791 additions
and
157,119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
arr = [input().split("|") for i in range(15)] | ||
|
||
import re | ||
res = [] | ||
for i in arr: | ||
res.append([]) | ||
res[-1].append(i[0].strip()) | ||
for j in range(1, len(i)): | ||
res[-1].extend(re.split(r"\s",i[j].strip())) | ||
|
||
print(" |", end="") | ||
for i in range(1, 10): | ||
print(f" {i} ", end="|") | ||
|
||
print() | ||
print(" |", end="") | ||
for i in range(1, 10): | ||
print(f" H L ", end="|") | ||
|
||
print() | ||
for i in res: | ||
print(f"{i[0]:24}", end=",") | ||
for j in range(1, len(i)): | ||
if i[j] != "": print(f"{i[j]:6}", end=",") | ||
print() | ||
|
||
|
||
######################################################################################## | ||
### EXCEL formula ### | ||
|
||
# =SUM(B26:B40) | ||
# =SUM(C26:C40) | ||
|
||
# =MIN(B42,D42,F42,H42,J42,L42,N42,P42,R42) | ||
# =MIN(C42,E42,G42,I42,K42,M42,O42,Q42,S42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import numpy as np | ||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
import seaborn as sns | ||
|
||
# INPUT | ||
names = np.array(["std::sort", "pdqsort", "std::stable_sort", "spinsort", "flat_stable_sort", "spreadsort", "timsort", "skasort", "fm_sort\noptimization"])[::-1] | ||
Averages = [174.19, 30.06, 104.68, 20.04, 152.71, 151.56, 86.94, 59.96, 70.32, 50.75, 61.38, 17.42, 77.88, 67.69, 42.41, 27.85, 27.55, 10.08][::-1] | ||
range_limit = 1000 | ||
graph_title = 'Array size = 2.98 GB\nArray length = 781250\nObject size = 4 K bytes = vector<uint64_t>[512]' | ||
y_label_name = f'Running time - normalized to range[0, {range_limit}]' | ||
|
||
names2 = [] | ||
for i in names: | ||
names2.append(i) | ||
names2.append(i) | ||
|
||
v1 = np.array(Averages[::2]) | ||
v2 = np.array(Averages[1::2]) | ||
v1 = v1 * range_limit / v1.max() | ||
v2 = v2 * range_limit / v2.max() | ||
|
||
p1 = pd.DataFrame([names, v1]).T | ||
p2 = pd.DataFrame([names, v2]).T | ||
p3 = pd.DataFrame([names2, Averages, len(names)*["Light comparison","Heavy comparison"]], index=["Sorting technique", "Average execution time" ,"Data comparision type"]).T | ||
p3["Average execution time"] = p3["Average execution time"] * range_limit / p3["Average execution time"].max() | ||
|
||
# GRAPH type 1 | ||
x_pos = range(len(names)) | ||
plt.bar(x_pos, v1) | ||
plt.xticks(x_pos, names) | ||
plt.yticks(range(0, range_limit+1, range_limit//10), [str(i) for i in range(0, range_limit+1, range_limit//10)]) | ||
plt.ylabel(y_label_name) | ||
plt.title(graph_title) | ||
plt.show() | ||
|
||
# GRAPH type 2 | ||
sns.set(style="whitegrid") | ||
ax = sns.barplot(x="Sorting technique", y="Average execution time", hue="Data comparision type", data=p3, palette=sns.color_palette("coolwarm", 17)[0::16] ) | ||
# ax.axhline(0, color="k", clip_on=False) | ||
|
||
for p in ax.patches: | ||
ax.annotate(f"{p.get_height():.0f}", (p.get_x() * 1.005, p.get_height() * 1.005)) | ||
|
||
# for ticks in ax.xaxis.get_major_ticks(): | ||
# if ticks.label1.get_text() == names[-1]: | ||
# # ticks.label1.set_facecolor("red") | ||
# # ax.patches[p3.index.get_indexer([ticks.label1.get_text()])[0]].set_facecolor('red') | ||
# ax.patches[p3.index.get_indexer([ticks.label1.get_text()])[0]].set_facecolor('red') | ||
|
||
plt.yticks(range(0, range_limit+1, range_limit//10), [str(i) for i in range(0, range_limit + 1, range_limit//10)]) | ||
plt.ylabel(y_label_name) | ||
plt.title(graph_title) | ||
plt.tight_layout(h_pad=2) | ||
plt.show() | ||
|
||
|
||
# REFER: https://seaborn.pydata.org/tutorial/color_palettes.html | ||
# REFER: https://seaborn.pydata.org/examples/color_palettes.html | ||
# default_color_palette = sns.color_palette() | ||
# cool_warm_tuple = sns.color_palette("coolwarm", 17) | ||
# sns.palplot(cool_warm_tuple) | ||
# plt.show() |
82 changes: 82 additions & 0 deletions
82
graphs_and_analysis/Graphs_v3/time_comparision_128_1562500.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
|
||
************************************************************ | ||
** ** | ||
** B O O S T S O R T ** | ||
** ** | ||
** O B J E C T S B E N C H M A R K ** | ||
** ** | ||
************************************************************ | ||
|
||
============================================================= | ||
= OBJECT COMPARISON = | ||
= --------------------- = | ||
= = | ||
= The objects are arrays of 64 bits numbers = | ||
= They are compared in two ways : = | ||
= (H) Heavy : The comparison is the sum of all the numbers = | ||
= of the array = | ||
= (L) Light : The comparison is with the first element of = | ||
= the array, as a key = | ||
= = | ||
============================================================ | ||
|
||
|
||
************************************************************ | ||
** ** | ||
1562500 OBJECTS UINT64_T [128] | ||
** ** | ||
************************************************************ | ||
|
||
[ 1 ] std::sort [ 2 ] pdqsort [ 3 ] std::stable_sort | ||
[ 4 ] spinsort [ 5 ] flat_stable_sort [ 6 ] spreadsort | ||
[ 7 ] timsort [ 8 ] skasort [ 9 ] timsort with swapping optimization | ||
|
||
| [ 1 ] | [ 2 ] | [ 3 ] | [ 4 ] | [ 5 ] | [ 6 ] | [ 7 ] | [ 8 ] | [ 9 ] | | ||
| H L | H L | H L | H L | H L | H L | H L | H L | H L | | ||
--------------------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+ | ||
random | 4.93 2.10| 2.55 0.83| 5.50 5.17| 2.96 1.98| 2.81 1.62| 1.93 0.52| 4.48 3.27| 1.63 1.20| 2.64 0.66| | ||
| | | | | | | | | | | ||
sorted | 5.15 1.52| 0.55 0.03| 5.28 5.01| 0.18 0.01| 0.18 0.01| 0.18 0.01| 0.20 0.01| 1.29 0.96| 0.19 0.02| | ||
sorted + 0.1% end | 6.08 1.50| 0.92 0.05| 5.30 5.05| 1.06 0.70| 0.24 0.03| 1.04 0.18| 0.23 0.02| 1.31 0.95| 0.22 0.03| | ||
sorted + 1% end | 5.70 1.69| 0.88 0.05| 5.39 5.16| 1.11 0.69| 0.24 0.03| 0.91 0.17| 0.24 0.02| 1.29 0.96| 0.25 0.04| | ||
sorted + 10% end | 5.95 1.83| 0.70 0.05| 5.76 5.44| 1.40 0.93| 0.33 0.09| 1.02 0.19| 0.33 0.06| 1.42 1.07| 0.31 0.07| | ||
| | | | | | | | | | | ||
sorted + 0.1% mid | 7.24 2.78| 2.47 0.03| 5.36 4.97| 2.54 0.01| 0.85 0.01| 1.73 0.01| 0.57 0.01| 1.28 0.55| 0.32 0.02| | ||
sorted + 1% mid | 6.31 2.80| 2.45 0.03| 5.43 5.06| 2.58 0.01| 1.13 0.01| 1.71 0.01| 0.61 0.01| 1.30 0.56| 0.36 0.02| | ||
sorted + 10% mid | 5.56 3.06| 2.47 0.03| 5.85 5.49| 2.91 0.01| 1.30 0.01| 1.41 0.02| 1.08 0.01| 1.56 0.61| 0.76 0.02| | ||
| | | | | | | | | | | ||
reverse sorted | 4.29 1.64| 0.60 0.24| 5.37 5.11| 1.61 1.23| 1.39 0.92| 1.56 0.49| 1.04 0.82| 1.47 1.16| 0.54 0.36| | ||
rv sorted + 0.1% end| 7.02 2.55| 2.17 0.41| 5.33 5.12| 1.57 1.24| 1.12 0.71| 1.51 0.49| 1.03 0.82| 1.46 1.17| 0.56 0.37| | ||
rv sorted + 1% end| 5.98 2.28| 2.20 0.42| 5.40 5.25| 1.60 1.29| 1.14 0.73| 1.51 0.49| 1.05 0.84| 1.49 1.22| 0.59 0.38| | ||
rv sorted + 10% end| 5.58 2.26| 2.21 0.46| 5.84 5.62| 1.89 1.44| 1.33 0.76| 1.55 0.51| 1.12 0.84| 1.64 1.30| 0.64 0.41| | ||
| | | | | | | | | | | ||
rv sorted + 0.1% mid| 7.31 2.74| 1.00 0.03| 5.40 4.97| 3.55 0.01| 1.46 0.01| 1.51 0.01| 2.46 0.01| 1.46 0.55| 0.60 0.02| | ||
rv sorted + 1% mid| 6.40 2.75| 0.99 0.03| 5.46 5.01| 3.61 0.01| 2.37 0.01| 1.54 0.01| 2.53 0.01| 1.49 0.56| 0.65 0.02| | ||
rv sorted + 10% mid| 5.80 3.04| 1.04 0.03| 6.04 5.60| 3.97 0.01| 2.50 0.02| 1.65 0.02| 3.20 0.01| 1.64 0.62| 1.16 0.02| | ||
--------------------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+ | ||
|
||
|
||
|
||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | ||
| H L | H L | H L | H L | H L | H L | H L | H L | H L | | ||
random ,4.93 ,2.10 ,2.55 ,0.83 ,5.50 ,5.17 ,2.96 ,1.98 ,2.81 ,1.62 ,1.93 ,0.52 ,4.48 ,3.27 ,1.63 ,1.20 ,2.64 ,0.66 , | ||
sorted ,5.15 ,1.52 ,0.55 ,0.03 ,5.28 ,5.01 ,0.18 ,0.01 ,0.18 ,0.01 ,0.18 ,0.01 ,0.20 ,0.01 ,1.29 ,0.96 ,0.19 ,0.02 , | ||
sorted + 0.1% end ,6.08 ,1.50 ,0.92 ,0.05 ,5.30 ,5.05 ,1.06 ,0.70 ,0.24 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 ,0.38 , | ||
rv sorted + 10% end ,5.58 ,2.26 ,2.21 ,0.46 ,5.84 ,5.62 ,1.89 ,1.44 ,1.33 ,0.76 ,1.55 ,0.51 ,1.12 ,0.84 ,1.64 ,1.30 ,0.64 ,0.41 , | ||
rv sorted + 0.1% mid ,7.31 ,2.74 ,1.00 ,0.03 ,5.40 ,4.97 ,3.55 ,0.01 ,1.46 ,0.01 ,1.51 ,0.01 ,2.46 ,0.01 ,1.46 ,0.55 ,0.60 ,0.02 , | ||
rv sorted + 1% mid ,6.40 ,2.75 ,0.99 ,0.03 ,5.46 ,5.01 ,3.61 ,0.01 ,2.37 ,0.01 ,1.54 ,0.01 ,2.53 ,0.01 ,1.49 ,0.56 ,0.65 ,0.02 , | ||
rv sorted + 10% mid ,5.80 ,3.04 ,1.04 ,0.03 ,6.04 ,5.60 ,3.97 ,0.01 ,2.50 ,0.02 ,1.65 ,0.02 ,3.20 ,0.01 ,1.64 ,0.62 ,1.16 ,0.02 , | ||
|
||
Averages = [89.3, 34.54, 23.2, 2.72, 82.71, 78.03, 32.54, 9.57, 18.39, 4.97, 20.76, 3.13, 20.17, 6.76, 21.73, 13.44, 9.79, 2.46] | ||
Best = [9.79, 2.46] | ||
|
||
Array length = 1562500 | ||
OBJECTS UINT64_T [128] |
Oops, something went wrong.