aboutsummaryrefslogtreecommitdiff
path: root/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'analysis')
-rw-r--r--analysis/vis.livemd65
1 files changed, 50 insertions, 15 deletions
diff --git a/analysis/vis.livemd b/analysis/vis.livemd
index 044e41f..2fa59d2 100644
--- a/analysis/vis.livemd
+++ b/analysis/vis.livemd
@@ -132,9 +132,11 @@ mapping_impls = ["HashMap", "BTreeMap"]
list_impls = ["Vec", "LinkedList", "SortedVec"]
stack_impls = ["Vec", "LinkedList"]
-inspect_op = "insert"
-# impls = set_impls ++ list_impls
-impls = mapping_impls
+inspect_op = "clear"
+# impls = set_impls ++ list_impls ++ mapping_impls
+impls = ["Vec"]
+# impls = mapping_impls
+# impls = ["SortedUniqueVec", "SortedVec"]
Tucan.layers([
cost_models
@@ -160,7 +162,7 @@ Tucan.layers([
|> Tucan.Axes.set_y_title("Estimated cost")
|> Tucan.Axes.set_x_title("Size of container (n)")
|> Tucan.Scale.set_x_domain(startn, endn)
-|> Tucan.Scale.set_y_domain(0, 200)
+# |> Tucan.Scale.set_y_domain(0, 200)
|> Tucan.set_size(500, 250)
|> Tucan.Legend.set_title(:color, "Implementation")
|> Tucan.Legend.set_orientation(:color, "bottom")
@@ -316,33 +318,54 @@ estimated_costs =
|> DF.new()
```
-## Estimates vs results
+## Estimates vs results (ignoring adaptive containers)
```elixir
-# Compare each assignments position in the estimates to its position in the results
-sorted_estimates =
+# Don't worry about adaptive containers for now
+singular_estimated_costs =
estimated_costs
+ |> DF.to_rows_stream()
+ |> Enum.filter(fn %{"using" => using} ->
+ Enum.all?(using, fn %{"impl" => impl} -> !String.contains?(impl, "until") end)
+ end)
+ |> DF.new()
+
+singular_benchmarks =
+ benchmarks
+ |> DF.to_rows_stream()
+ |> Enum.filter(fn %{"using" => using} ->
+ Enum.all?(using, fn %{"impl" => impl} -> !String.contains?(impl, "until") end)
+ end)
+ |> DF.new()
+
+DF.n_rows(singular_benchmarks)
+```
+
+```elixir
+# Compare each assignments position in the estimates to its position in the results
+sorted_singular_estimates =
+ singular_estimated_costs
|> DF.group_by(["proj"])
|> DF.sort_by(estimated_cost)
-sorted_results =
- benchmarks
+sorted_singular_results =
+ singular_benchmarks
|> DF.group_by(["proj"])
|> DF.sort_by(time)
-position_comparison =
- sorted_estimates
+singular_position_comparison =
+ sorted_singular_estimates
|> DF.to_rows_stream()
|> Enum.map(fn %{"proj" => proj, "using" => using} ->
%{
proj: proj,
using: using,
pos_estimate:
- DF.filter(sorted_estimates, proj == ^proj)["using"]
+ DF.filter(sorted_singular_estimates, proj == ^proj)["using"]
|> SE.to_list()
|> Enum.find_index(fn u -> u == using end),
pos_results:
- DF.filter(sorted_results, proj == ^proj)["using"]
+ DF.filter(sorted_singular_results, proj == ^proj)["using"]
|> SE.to_list()
|> Enum.find_index(fn u -> u == using end)
}
@@ -352,7 +375,19 @@ position_comparison =
```elixir
# Everywhere we predicted wrong.
-position_comparison
-|> DF.filter(pos_estimate != pos_results)
+singular_position_comparison
+|> DF.filter(pos_estimate == 0 and pos_estimate != pos_results)
|> DF.collect()
```
+
+```elixir
+singular_estimated_costs
+|> DF.filter(proj == "aoc_2022_14")
+|> DF.sort_by(estimated_cost)
+```
+
+```elixir
+singular_benchmarks
+|> DF.filter(proj == "aoc_2022_14")
+|> DF.sort_by(time)
+```