领英怎么用了 3.5 GB 的内存?
1 分•作者: hdjY28•4 个月前
我最初是在 Chrome 上看到的,决定在 Safari 上测试一下。结果数据非常相似。<p>我还把它和 Facebook 做了对比,刻意滚动 5 分钟,最多消耗了 650 MB,平均大约 400 MB。<p>有没有 Web 开发者能解释一下 LinkedIn 和 Facebook 之间如此巨大的差异?看起来信息流中的视觉信息量几乎相同,但 LinkedIn 却占用了 5-7 倍的内存。<p>我查了一下,Facebook 使用 React 和虚拟 DOM,而 LinkedIn 使用 Ember(以前从未听说过)。难道仅仅是因为 Facebook 在不再需要 JavaScript 对象时,能更好地动态清除它们吗?
查看原文
I saw it first on Chrome, decided to test in Safari. Very similar numbers.<p>I also compared it with Facebook, with 5 minute deliberate scrolling I got it to consume 650 MB at most, with average being about 400 MB.<p>Any web developers who can explain the huge discrepancy between LinkedIn and Facebook? It seems like the amount of visual information is almost the same in the feed, yet LinkedIn takes up 5-7x more memory.<p>I looked up, Facebook uses React and the virtual DOM, whereas LinkedIn uses Ember (never heard of that one before). Is it simply that Facebook is better about dynamically kicking out JavaScript objects when they'ren no longer needed?