Skip to content

Commit

Permalink
add normalized runningtime plots
Browse files Browse the repository at this point in the history
  • Loading branch information
k-dominik committed Aug 30, 2024
1 parent 13aa71e commit f575246
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Results.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ generated {{ now }}, from results of {{ n_hosts }} machines

### Time

#### Absolute

![unique-runningtime](unique-runningtime.png)

#### Normalized to `numpy.unique` for each shape/host combination

![unique-runningtime-normalized](unique-runningtime-normalized.png)


## Bincount

### Memory usage
Expand All @@ -20,5 +27,10 @@ generated {{ now }}, from results of {{ n_hosts }} machines

### Time

#### Absolute

![bincount-runningtime](bincount-runningtime.png)

#### Normalized to `numpy.bincount` for each shape/host combination

![bincount-runningtime-normalized](bincount-runningtime-normalized.png)
80 changes: 80 additions & 0 deletions generate-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@ def gen_plots():

p.clear()

# normalize data
# method shape t py_version npy_version pandas_version vigra_version host platform mem_min mem_max
np_unique = results_unique[results_unique["method"] == "numpy.unique(data)"]

normalization_factors = {}

for _, row in np_unique.iterrows():
key = (
row["host"],
row["platform"],
row["shape"],
row["py_version"],
row["npy_version"],
row["pandas_version"],
row["vigra_version"],
)
normalization_factors[key] = row["t"]

def normalize(row):
key = (
row["host"],
row["platform"],
row["shape"],
row["py_version"],
row["npy_version"],
row["pandas_version"],
row["vigra_version"],
)
return row["t"] / normalization_factors[key]

results_unique["normalized_t"] = results_unique.apply(normalize, axis=1)

p = sns.lineplot(x="shape_ind", y="normalized_t", hue="method", data=results_unique)
p.set(yscale="log")
fig = p.get_figure()
fig.savefig("unique-runningtime-normalized.png")

p.clear()


results_bincount = pandas.read_csv("results-bincount.csv", sep="\t")

results_bincount["shape_ind"] = results_bincount["shape"].map(shape_index_mapping)
Expand All @@ -56,6 +96,46 @@ def gen_plots():

p.clear()

# normalize data
# method shape t py_version npy_version pandas_version vigra_version host platform mem_min mem_max
np_bincount = results_bincount[results_bincount["method"] == "numpy.bincount(data.reshape(-1))"]

normalization_factors = {}

for _, row in np_bincount.iterrows():
key = (
row["host"],
row["platform"],
row["shape"],
row["py_version"],
row["npy_version"],
row["pandas_version"],
row["vigra_version"],
)
normalization_factors[key] = row["t"]

def normalize(row):
key = (
row["host"],
row["platform"],
row["shape"],
row["py_version"],
row["npy_version"],
row["pandas_version"],
row["vigra_version"],
)
return row["t"] / normalization_factors[key]

results_bincount["normalized_t"] = results_bincount.apply(normalize, axis=1)

p = sns.lineplot(x="shape_ind", y="normalized_t", hue="method", data=results_bincount)
p.set(yscale="log")
fig = p.get_figure()
fig.savefig("bincount-runningtime-normalized.png")

p.clear()



def main():
template = Template(Path("Results.md.in").read_text())
Expand Down

0 comments on commit f575246

Please sign in to comment.