lbry-desktop/ui
infinite-persistence cded632fd2
DateTime: avoid unnecessary update (#6110)
## Issue
Part of `5834 Performance investigation`

In a homepage with 120 tiles, the lists get rendered 3 times during initial update. The sub-components are updating recursively (will investigate), so instead of 120 DateTime renders, we have 1000+ renders.

The resolved DateTime string for `timeAgo` rarely changes, and even if the string was "a few seconds ago", there's no real need to constantly update it.

## Change
Require a minimum 1-minute delta when deciding whether the component should update. Clients can change this value as needed.

## Test
- [x] Verified `shouldComponentUpdate` doesn't end up taking more time than not having it (it's in micro-second range, compared to the millisecond render).
- [x] Profiler showed no significant improvement for low number of DateTime components, but for the 120 DateTime case, almost 1/4 of a second is saved.
2021-05-24 18:29:58 -04:00
..
component DateTime: avoid unnecessary update (#6110) 2021-05-24 18:29:58 -04:00
constants Notification: handle "creator_comment" (#6069) 2021-05-14 10:59:36 -04:00
effects Fix blank gif avatars (#6060) 2021-05-14 11:00:07 -04:00
modal allow sending directly to a channel or content address (#5990) 2021-05-20 15:30:40 -04:00
page allow sending directly to a channel or content address (#5990) 2021-05-20 15:30:40 -04:00
redux fetch notofication/categories for notification types dropdown 2021-04-30 12:45:46 -04:00
scss Markdown editor tweaks (#6096) 2021-05-20 15:31:14 -04:00
util allow sending directly to a channel or content address (#5990) 2021-05-20 15:30:40 -04:00
analytics.js integrate some Odysee code with master 2021-04-27 19:56:30 -04:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
comments.js hyperchats 2021-04-23 16:20:17 -04:00
i18n.js Revert "Simplify language lists" 2021-04-06 15:42:27 -04:00
index.jsx When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js working 2020-12-16 10:52:22 -05:00
reducers.js use redux for livestream claim setup 2021-04-23 14:51:09 -04:00
rewards.js When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
store.js CoinSwap: websocket + multi-coin 2021-04-13 14:02:25 -04:00