V8中的垃圾收集器和并发标记 [英] Garbage Collector and concurrent marking in V8

查看:75
本文介绍了V8中的垃圾收集器和并发标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此处了解有关V8 GC的信息.由于这个新的GC使用工作线程执行并发标记,所以我想知道当cpus> 1时总体性能是否更好.GC会运行得更快吗?有没有人比较这两种情况?

I'm reading about V8 GC here. As this new GC uses workers threads to perform concurrent marking I wonder if the overall performance is better when there is > 1 cpus. Will GC run faster ? Has anyone compared both scenarios ?

我的应用未群集.

推荐答案

是的,如果您有多个CPU内核,则只能从并发操作(在V8或其他地方)中获得速度上的好处.

Yes, you will only get a speed benefit from concurrent operations (in V8 or elsewhere) if you have more than one CPU core.

实际的性能影响取决于您应用程序的具体情况,因此,如果您想要实际适用于您的案例的结果,则必须自己进行衡量.粗略估计,我希望整体吞吐量差异达到百分之几":大多数JavaScript是单线程的,并且在大多数应用中,垃圾回收约占CPU负载的2-10%.

The actual performance impact depends on the specifics of your app, so you'll have to measure it yourself if you want results that actually apply to your case. As a rough guess, I would expect "a couple percent" of overall throughput difference: most of JavaScript is single-threaded, and in most apps garbage collection accounts for about 2-10% of CPU load.

这篇关于V8中的垃圾收集器和并发标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆