Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

javascript - 什么阻止Ruby,Python来获得Javascript V8的速度? [关闭](What blocks Ruby, Python to get Javascript V8 speed? [closed])

Are there any Ruby / Python features that are blocking implementation of optimizations (eg inline caching ) V8 engine has?

(是否存在阻止优化实现的Ruby / Python功能(例如内联缓存 )V8引擎?)

Python is co-developed by Google guys so it shouldn't be blocked by software patents.

(Python由Google员工共同开发,因此不应被软件专利阻止。)

Or this is rather matter of resources put into the V8 project by Google.

(或者这是谷歌为V8项目投入资源的问题。)

  ask by Greg Dan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

What blocks Ruby, Python to get Javascript V8 speed?

(什么阻止Ruby,Python来获得Javascript V8的速度?)

Nothing.

(没有。)

Well, okay: money.

(好吧,好吧:钱。)

(And time, people, resources, but if you have money, you can buy those.)

((和时间,人,资源,但如果你有钱,你可以买。))

V8 has a team of brilliant, highly-specialized, highly-experienced (and thus highly-paid) engineers working on it, that have decades of experience (I'm talking individually – collectively it's more like centuries) in creating high-performance execution engines for dynamic OO languages.

(V8拥有一支精干,高度专业化,经验丰富(因而又高薪)的工程师团队,他们在创建高性能执行方面拥有数十年的经验(我正在单独谈论 - 更像是几个世纪)动态OO语言的引擎。)

They are basically the same people who also created the Sun HotSpot JVM (among many others).

(他们基本上也是创建Sun HotSpot JVM(以及其他许多人)的人。)

Lars Bak, the lead developer, has been literally working on VMs for 25 years (and all of those VMs have lead up to V8), which is basically his entire (professional) life.

(首席开发人员Lars Bak已经在虚拟机上工作了25年(并且所有这些虚拟机都已经领先于V8),这基本上是他的整个(专业)生活。)

Some of the people writing Ruby VMs aren't even 25 years old.

(一些编写Ruby VM的人甚至还不到25岁。)

Are there any Ruby / Python features that are blocking implementation of optimizations (eg inline caching) V8 engine has?

(是否存在阻止优化实现的Ruby / Python功能(例如内联缓存)V8引擎?)

Given that at least IronRuby, JRuby, MagLev, MacRuby and Rubinius have either monomorphic (IronRuby) or polymorphic inline caching, the answer is obviously no.

(鉴于至少IronRuby,JRuby,MagLev,MacRuby和Rubinius都有单态(IronRuby)或多态内联缓存,答案显然是否定的。)

Modern Ruby implementations already do a great deal of optimizations.

(现代Ruby实现已经进行了大量优化。)

For example, for certain operations, Rubinius's Hash class is faster than YARV's.

(例如,对于某些操作,Rubinius的Hash类比YARV快。)

Now, this doesn't sound terribly exciting until you realize that Rubinius's Hash class is implemented in 100% pure Ruby, while YARV's is implemented in 100% hand-optimized C.

(现在,直到你意识到Rubinius的Hash类是用100%纯Ruby实现的,而YARV是在100%手动优化的C中实现的,这听起来并不令人兴奋。)

So, at least in some cases, Rubinius can generate better code than GCC!

(所以,至少在某些情况下,Rubinius可以生成比GCC更好的代码!)

Or this is rather matter of resources put into the V8 project by Google.

(或者这是谷歌为V8项目投入资源的问题。)

Yes.

(是。)

Not just Google.

(不只是谷歌。)

The lineage of V8's source code is 25 years old now.

(V8的源代码现已有25年历史了。)

The people who are working on V8 also created the Self VM (to this day one of the fastest dynamic OO language execution engines ever created), the Animorphic Smalltalk VM (to this day one of the fastest Smalltalk execution engines ever created), the HotSpot JVM (the fastest JVM ever created, probably the fastest VM period) and OOVM (one of the most efficient Smalltalk VMs ever created).

(正在开发V8的人们还创建了自我虚拟机(迄今为止创建的最快的动态OO语言执行引擎之一),Animorphic Smalltalk虚拟机(迄今为止创建的最快的Smalltalk执行引擎之一),HotSpot JVM(有史以来最快的JVM,可能是最快的VM时期)和OOVM(有史以来最有效的Smalltalk VM之一)。)

In fact, Lars Bak, the lead developer of V8, worked on every single one of those, plus a few others.

(事实上,V8的首席开发人员Lars Bak在其中每一个上工作,还有其他几个。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...