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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: 60FPS smooth, no matter how janky app was due to heavy build/layout

12 点作者 fzyzcjy超过 2 年前

2 条评论

fzyzcjy超过 2 年前
Hi friends, after a month working on it full-time, I managed to make arbitrary Flutter apps ~60FPS smooth regardless of how janky it originally was due to build&#x2F;layout.<p>For demonstration, there is a 3-second video in GitHub README. You can also find more details in the &quot;Benchmark&quot; chapter, where I experimented it and see it runs at (roughly) full FPS, feel smooth, has zero uncomfortable janks, with negligible overhead.<p>There are two ways to use it: For common scenarios, just add six letters (&quot;smooth&quot;), such as using SmoothListView instead of ListView. For complex cases where you want customization, use SmoothBuilder and put things that you need to be smooth inside the builder (just like how you use Builder everyday, but smooth).<p>As for how it is implemented, I have written down a full chapter (&quot;Design&quot; chapter) in the documentation.<p>Story time: Indeed I have failed a ton of times before finding out this solution. The &quot;literature review&quot; section summarizes them so I do not repeat here. It is another ton of failures before the theory becomes truth. At around half a month I was almost going to give up, because it stuck at less than 40-50FPS instead of the perfect ~60FPS, and my theory seems does not consider the scenario after a janky frame properly at all. But later I managed to patch my theory to fix the problem (seen in &quot;post draw frame&quot; section of doc). After that I fixed many edge cases one by one, where each problem causes (for example) 1FPS drop, then finally reached near 60FPS.
vanillax超过 2 年前
Interesting. I still don&#x27;t see a ELI5 explanation how you achieve this? If this fixes Flutter, why not put these changes in the main Flutter source? I&#x27;m a bit confused, if this is a 60 fps for free with some renaming, why is it that easy? Something feels fishy here. This is cool, dont get me wrong, but I just dont see how its &quot;this&quot; easy to fix jank&#x2F;60 fps.
评论 #33367101 未加载