From bad6b11c5dfd08b6c4429969013c27d3700f3023 Mon Sep 17 00:00:00 2001 From: Gabi Zuniga Date: Sun, 25 Oct 2015 12:40:46 -0700 Subject: [PATCH] Change PG2 ETS from bag to duplicate_bag to improve insert performance for elements with same key --- lib/phoenix/pubsub/local.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phoenix/pubsub/local.ex b/lib/phoenix/pubsub/local.ex index 6000d6b6d7..2213933274 100644 --- a/lib/phoenix/pubsub/local.ex +++ b/lib/phoenix/pubsub/local.ex @@ -144,7 +144,7 @@ defmodule Phoenix.PubSub.Local do end def init({local, gc}) do - ^local = :ets.new(local, [:bag, :named_table, :public, + ^local = :ets.new(local, [:duplicate_bag, :named_table, :public, read_concurrency: true, write_concurrency: true]) Process.flag(:trap_exit, true) {:ok, gc}