TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Redux Performance Tips

1 点作者 bloomca超过 2 年前

1 comment

acemarke超过 2 年前
Hi, I&#x27;m a Redux maintainer. This is a good post, but I&#x27;m a bit surprised it doesn&#x27;t talk about memoized selector functions at all. We specifically teach those as a way to improve performance, by avoiding costly transformations and consistently returning the same result reference until the inputs change:<p>- <a href="https:&#x2F;&#x2F;redux.js.org&#x2F;tutorials&#x2F;essentials&#x2F;part-6-performance-normalization#improving-render-performance" rel="nofollow">https:&#x2F;&#x2F;redux.js.org&#x2F;tutorials&#x2F;essentials&#x2F;part-6-performance...</a><p>- <a href="https:&#x2F;&#x2F;redux.js.org&#x2F;tutorials&#x2F;fundamentals&#x2F;part-7-standard-patterns#memoized-selectors" rel="nofollow">https:&#x2F;&#x2F;redux.js.org&#x2F;tutorials&#x2F;fundamentals&#x2F;part-7-standard-...</a><p>- <a href="https:&#x2F;&#x2F;redux.js.org&#x2F;usage&#x2F;deriving-data-selectors" rel="nofollow">https:&#x2F;&#x2F;redux.js.org&#x2F;usage&#x2F;deriving-data-selectors</a><p>Use of `React.memo()` also helps in cases like the large list, especially if you&#x27;re only passing down the item ID as props to the list item components and letting them select their own data based on that ID.<p>Also, as of Reselect 4.1, there are some additional options built into `createSelector` for doing comparisons, such as an option that can do a shallow equality check on the _new_ result, and stick with the _old_ result if they&#x27;re the same:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;reduxjs&#x2F;reselect#defaultmemoizefunc-equalitycheckoroptions--defaultequalitycheck">https:&#x2F;&#x2F;github.com&#x2F;reduxjs&#x2F;reselect#defaultmemoizefunc-equal...</a>