Skip to content

Instantly share code, notes, and snippets.

@zoldar
Created December 16, 2020 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoldar/d99c636a933725c73d2a4f7131fdd936 to your computer and use it in GitHub Desktop.
Save zoldar/d99c636a933725c73d2a4f7131fdd936 to your computer and use it in GitHub Desktop.
tables = :ets.all() |> Enum.map(fn tab -> {tab, :ets.info(tab, :name)} end) |> Enum.filter(fn {tab, name} -> String.starts_with?(Atom.to_string(name), "Elixir.AppWeb.Endpoint.Registry.KeyPart") end)
IO.inspect Enum.map(tables, fn {tab, _} -> (:ets.info(tab, :memory) * :erlang.system_info(:wordsize)) - 10648 end) |> Enum.sum(), label: :SIZE
## BEFORE
SIZE: 65256
SIZE: 65256
SIZE: 65128
SIZE: 65256
SIZE: 66392
SIZE: 67816
SIZE: 67944
SIZE: 66408
SIZE: 65128
SIZE: 68056
SIZE: 68056
SIZE: 66344
SIZE: 66408
SIZE: 66520
SIZE: 68184
SIZE: 66392
SIZE: 65128
SIZE: 65000
SIZE: 65256
SIZE: 65128
SIZE: 66792
SIZE: 66344
SIZE: 132688
SIZE: 199032
SIZE: 265376
SIZE: 66792
SIZE: 68200
SIZE: 66792
SIZE: 66792
SIZE: 68312
SIZE: 66392
SIZE: 0
SIZE: 0
SIZE: 0
SIZE: 0
SIZE: 206936
SIZE: 65128
SIZE: 65128
SIZE: 65128
SIZE: 206936
SIZE: 65128
SIZE: 65000
SIZE: 65000
SIZE: 65000
SIZE: 64872
SIZE: 65000
SIZE: 130000
SIZE: 65000
SIZE: 65032
SIZE: 65000
SIZE: 130000
SIZE: 68696
SIZE: 68696
SIZE: 68824
SIZE: 68696
SIZE: 66664
SIZE: 66792
SIZE: 91720
SIZE: 91720
SIZE: 183440
SIZE: 143336
SIZE: 143592
SIZE: 143336
SIZE: 143592
SIZE: 143336
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
SIZE: 91720
SIZE: 183440
## AFTER
SIZE: 4512
SIZE: 9024
SIZE: 13536
SIZE: 18048
SIZE: 4504
SIZE: 4560
SIZE: 4600
SIZE: 4496
SIZE: 4488
SIZE: 4672
SIZE: 4664
SIZE: 4496
SIZE: 4600
SIZE: 4504
SIZE: 4672
SIZE: 4560
SIZE: 4600
SIZE: 4560
SIZE: 4568
SIZE: 4608
SIZE: 4664
SIZE: 4496
SIZE: 4568
SIZE: 4568
SIZE: 4520
SIZE: 4496
SIZE: 4680
SIZE: 4680
SIZE: 4496
SIZE: 4672
SIZE: 4496
SIZE: 0
SIZE: 0
SIZE: 0
SIZE: 0
SIZE: 4504
SIZE: 4504
SIZE: 13304
SIZE: 13304
SIZE: 4496
SIZE: 4488
SIZE: 4488
SIZE: 4520
SIZE: 4488
SIZE: 4488
SIZE: 8976
SIZE: 4496
SIZE: 9000
SIZE: 4488
SIZE: 4488
SIZE: 4488
SIZE: 4704
SIZE: 4696
SIZE: 4712
SIZE: 4704
SIZE: 4608
SIZE: 4600
SIZE: 6160
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 6160
SIZE: 12320
SIZE: 9336
SIZE: 9336
SIZE: 9352
SIZE: 9352
SIZE: 9336
SIZE: 6160
SIZE: 12320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment