跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 关于"好奇移动端、桌面端是怎么实现列表控件渲染大量元素不卡顿的?"引申的问题

发表于

上一个问题( https://www.v2ex.com/t/1059281 )我看已经讨论结束了,所以新开一个帖子来讨论下。

我的问题是,大量的列表会导致滑动卡顿吗?移动端有"回收,重用,缓存"这种策略,但如果不使用这种策略,而将大量的列表数据加载到内存中,滑动时候会卡顿吗?

我的理解是它们已经加载到内存中了,滑动只是将其展示出来,缺点是占用内存特别大。

如果使用了回收策略,只有屏幕展示的那几条列表会被加载到内存中,滑动出去的放到复用列表中,以供下次使用,这样可以节约大量内存,但在快速滚动刷新的列表中,这需要 cpu 进行大量的计算来刷新列表中的数据吧?

所以我觉得,如果不使用回收策略,那么 cpu 会在第一时间创建很多列表数据,这会导致一开始卡顿,创建完数据后,占用很大内存。但之后的刷新,不应该卡顿。

如果使用回收策略,内存压力小了,开始不需要进行大量的 cpu 计算,所以不会有开始渲染卡顿问题。但后面的快速刷新会消耗 cpu 。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.