Hey folks, protocol consolidation does not seem to work properly in umbrella apps.
See this in nicer formatting and with code here:
https://github.com/benwilson512/protocol-issue
If you run a function that uses a protocol heavily, it will be substantially slower when run from the umbrella root vs within the sub app directory, even when both are in production.
## Test Function
```elixir
def test do
0..1_000_000
|> Enum.each(fn(i) ->
%{x: [1,2,3]} |> Poison.encode!
end)
end
```
## From the umbrella dir
```elixir
$ MIX_ENV=prod iex -S mix
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.0.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> SubApp.benchmark
{11782348, :ok}
```
## From the sub project dir
```elixir
$ cd apps/sub_app/
ben:sub_app ben$ MIX_ENV=prod iex -S mix
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.0.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> SubApp.benchmark
{1545892, :ok}
```
That's 7.6x slower from the umbrella dir.
Am I missing something?
Thanks!
- Ben