diff --git a/README.md b/README.md index c1af58a..be76678 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,6 @@ $ mix test ## LFE version [Here.](https://github.com/danieljaouen/dynamic-programming-in-lfe) -Note: The Elixir version is currently more performant due to parallel processing. - -Edit: Maybe not. Looks like ParalleStream adds a significant overhead. Check -your results with `:timer.tc(fn -> lowest_cose_path(...) end)` first and -perhaps modify your version of the code to not use ParallelStream. - ## License Apache License, Version 2.0 diff --git a/lib/dynamic_programming_in_elixir.ex b/lib/dynamic_programming_in_elixir.ex index 6e2d771..db1286a 100644 --- a/lib/dynamic_programming_in_elixir.ex +++ b/lib/dynamic_programming_in_elixir.ex @@ -55,7 +55,7 @@ defmodule DynamicProgrammingInElixir do {:error, "Cannot reach source from current path"} else in_edges - |> ParallelStream.map(fn edge -> calculate_current_path(g, source, edge) end) + |> Enum.map(fn edge -> calculate_current_path(g, source, edge) end) |> Enum.filter(fn x -> elem(x, 0) == :ok end) |> Enum.to_list() |> my_min()