623: It’s About Human Connection
https://atp.fm/623
Nerdy home-buying considerations, Hyperspace updates, the surprisingly difficult engineering challenge of scrolling, and how we're going to get through all of this.
🏳️🌈❤️🏳️⚧️
623: It’s About Human Connection
https://atp.fm/623
Nerdy home-buying considerations, Hyperspace updates, the surprisingly difficult engineering challenge of scrolling, and how we're going to get through all of this.
🏳️🌈❤️🏳️⚧️
@atpfm @siracusa I've just been listening to your Hyperspace table view discussion whilst putting together a basic AppKit example. I've started with 100,000 items in my table and it's smooth as silk when scrolling. I haven't done macOS development in some years now so I'm pretty rusty, was surprised I couldn't repro your issue. Any chance you kept the sample app demonstrating the problem?
I'm gonna try SwiftUI next, I imagine the issue will be easy to encounter there!
@Drarok Try a web browser with the same content to see how much smoother it can be. (Grab the scroll thumb and yank it around. Don’t just swipe.)
@Drarok Yeah, like I said on the show, web browsers give up after a certain point. But up to that point, they're smoother.
@siracusa I get what you're saying, but I couldn't disagree more. Even when comparing Chrome with 1000 items to native with 100,000 the performance of the latter is flawless for me.
@siracusa @Drarok Not sure where the bottleneck is is in the web view, but you may consider content-visibility and contain-intrinsic-size to help with performance https://css-tricks.com/almanac/properties/c/content-visibility/
@Drarok Funny, I'm in the process of switching to old-style NSCell because it does actually seem to make a difference in performance for my data/UI.
@siracusa weird! Do you have loads of columns? Without seeing any slowdown it's hard to guess where the issue might be. Might be worth identifying the root cause rather than going for refactor number... 6?
@Drarok Too late! I dunno why NSCell-based is faster, but it is (slightly). I tried to use Instruments but I don't know how to use it well enough to tell where the time was being spent.
@Drarok Are you using NSTableCellView or are you returning NSTextViews from tableView(_:viewFor:row:)? Or something else?
@siracusa returning NSTableViewCell instances in tableView(_:viewFor:row:) which are created by tableView.makeView(withIdentifier:owner:)
I think you might be holding something wrong!