Web: bounty explorer can be slow

Created on 23 Mar 2018  路  9Comments  路  Source: gitcoinco/web

repro steps

  1. https://gitcoin.co/explorer
  2. select 'any' on the left hand side, and clear all other filters
  3. click search
  4. for 180 results, it takes about 6 seconds.

technical debugging notes

the API returns in a few hundred ms. its not a backend issue.
i think it might be a frontend rendering problem... because the HTML is passed to the $('#bounties').append(html); line of code and it still takes like 5 seconds for the browser to paint it.

possible solutions

  1. find a JS performance fix
  2. implement pagination
  3. something else?

Most helpful comment

just put in stopgap fix to get us through the weekend: https://gitcoin.co/explorer

All 9 comments

Possible approach altho I'm not familiar with how Gitcoin does rendering: do just-in-time rendering of only Issues that are in the viewport and only populate additional issues when they need to be rendered.

@owocki this might already be what you're talking about with a pagination approach, but I like to be explicit 馃憤

wasnt what i was talking about with pagination.. but it is a good idea nonetheless!

This was one of the first things I implemented as a software engineer and one that I'm proud of :) Took a view that was taking ~60 seconds to load for large clients and dropped that down to <1 second with the same behavior 馃槏

Did this with an AngularJS directive tho so doesn't have 1:1 to Gitcoin's situation, altho think taking a look at a similar approach could be interesting 馃憤

@mkosowsk Pagination would help this for sure, but the explorer/dashboard view pulls in all results from the bounty api and paints via jsrender at the moment.

We could setup endless scrolling via jsrender paging of the whole bounty api response, DRF pagination, or a combination of the two.

@mbeacom which approach(es) do you think is appropriate to try first (possibly the one that's easiest to implement)? Could be a fun bounty for the community 馃槏

This would be a really fun task to take on! If available, I will give it a whirl 馃摕

just put in stopgap fix to get us through the weekend: https://gitcoin.co/explorer

tested on desktop / mobile in chrome

The old debounce... nice work!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbeacom picture mbeacom  路  4Comments

Skyge picture Skyge  路  3Comments

thelostone-mc picture thelostone-mc  路  4Comments

IgorPerikov picture IgorPerikov  路  3Comments

Makondor2 picture Makondor2  路  3Comments