Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Playing with the Knuth-Plass algorithm and I think it’s an interesting algorithm to visualize! Might write a complete visual article later, but here’s a quick comparison for now. It looks at the whole paragraph to find the breakpoints that produce the most uniform spacing. So unlike the greedy approach,...

169,923 görüntüleme • 1 ay önce •via X (Twitter)

0 Yorum

Yorum bulunmuyor

Orijinal gönderinin yorumları burada görünecek

Benzer Videolar

Experimenting with Legend List in the other app, which uses FlatList and performs surprisingly well already. I only really see it get slow after loading a lot of pages and then scrolling very quickly. I learned a lot from this! - Recycling looks great! I’m actually surprised it’s so much faster! And it doesn’t seem to do anything weird to the state in posts. - FlatList is pre-rendering 9 pages worth of posts so it scrolls smoothly through those, then it falls apart and blanks. Watching its behavior in the dev tools gave me some ideas to pre-render more intelligently. - Legend List seems slightly better than FlatList without recycling, but I think we can still get it to *much* better. When scrolling quickly through expensive list items, by the time they finish rendering they’re already off screen. So I think the best solution is to try to do better at predicting what *will* be on screen when scrolling quickly. - FlatList always keeps the first 4 items rendered at the top, so scrolling to the top looks great. We could consider doing that? Or maybe the prediction algorithm could have a special case for when it looks like a scroll to top. - The big difference in perf is that FlatList renders an array of all items in view, while Legend List renders absolutely positioned containers. So when adding an item, FL re-renders the whole array and LL updates one container. And with static positioning in FL a size change triggers a layout in the ScrollView, while with absolute positioning in LL it just updates a few style props on containers. - Legend List is not quite ready to drop in. Some event handlers (onScroll, onEndReached) appear to behave differently so I need to debug and fix those first, and will do more testing in Bluesky to find any other bugs. - It’s looking promising! 🎉

Jay Meistrich

23,667 görüntüleme • 1 yıl önce