optimize addresses page

the longest part of addreses page loading was fetching validation
count for every address.

addresses are loaded from cache. it takes less than a second but
fetching validation count takes more than 5 seconds.

Moreover, validation_count is not used.
pull/2745/head
Ayrat Badykov 5 years ago
parent 6d461f574c
commit 41fdb67cc5
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 3
      apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex
  2. 5
      apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex

@ -44,8 +44,7 @@ defmodule BlockScoutWeb.AddressController do
index: index, index: index,
exchange_rate: exchange_rate, exchange_rate: exchange_rate,
total_supply: total_supply, total_supply: total_supply,
tx_count: tx_count, tx_count: tx_count
validation_count: validation_count(address.hash)
) )
end) end)

@ -29,11 +29,6 @@
<span data-test="transaction_count"> <span data-test="transaction_count">
<%= @tx_count %> <%= @tx_count %>
</span> <%= gettext "Transactions sent" %> </span> <%= gettext "Transactions sent" %>
<% if validator?(@address) do %>
<span data-test="validation_count">
<%= @validation_count %>
</span> <%= gettext "Validations" %>
<% end %>
</span> </span>
</td> </td>
</tr> </tr>

Loading…
Cancel
Save