Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update performance.md #26

Merged
merged 2 commits into from
Oct 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cndocs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ if (!__DEV__) {

这样在打包发布时,所有的控制台语句就会被自动移除,而在调试时它们仍然会被正常调用。

### `ListView` initial rendering is too slow or scroll performance is bad for large lists
### `ListView` 首次渲染缓慢或者由于列表很大导致滑动很慢

Use the new [`FlatList`](flatlist.md) or [`SectionList`](sectionlist.md) component instead. Besides simplifying the API, the new list components also have significant performance enhancements, the main one being nearly constant memory usage for any number of rows.
用新的[`FlatList`](flatlist.md)或者[`SectionList`](sectionlist.md)组件替代。除了简化了API,这些新的列表组件在性能方面都有了极大的提升, 其中最主要的一个是无论列表有多少行,它的内存使用都是常数级的。

If your [`FlatList`](flatlist.md) is rendering slow, be sure that you've implemented [`getItemLayout`](https://facebook.github.io/react-native/flatlist.md#getitemlayout) to optimize rendering speed by skipping measurement of the rendered items.
如果你的[`FlatList`](flatlist.md)渲染得很慢, 请确保你使用了[`getItemLayout`](flatlist.md#getitemlayout),它通过跳过对items的处理来优化你的渲染速度。

### 在重绘一个几乎没有什么变化的页面时,JS 帧率严重降低

Expand Down