Android 是否阉割了 ARM 的 Jazelle 技术?

发布于 2024-07-27 12:29:08 字数 344 浏览 1 评论 0原文

我认为 Android 中的 Java 字节码“混蛋”的理由是性能。 (我怀疑还有另一个原因。)但是,通过更改字节码,他们难道没有让 Jazelle 等硬件加速技术变得毫无意义,从而实际上降低了 Mobile Java 平台的可用性能吗?

我知道目标平台是基于 ARM 的移动平台,这似乎违反直觉。 虽然它可能会在其他 CPU 架构上为您提供更好的性能,但它似乎对 ARM 和 Jazelle 吐口水。

它对 Java 性能有什么样的定量影响?

它真的能提高性能吗?如果能的话,如何提高性能?

对其他平台有何影响? (即 x86、mips、yadda、yadda、yadda...)

The justification that I've seen for shall we say "Bastardizing" the Java bytecodes in Android was performance. (I suspect there is another reason.) However by changing the byte codes haven't they made hardware acceleration technologies such as Jazelle moot, and thus actually degraded the performance available for a Mobile Java platform?

It appears counter intuitive to me knowing that the target platform is a ARM based mobile platform. While it MIGHT give you better performance on other CPU architectures it seems to spit in the face of ARM and Jazelle.

What sort of quantitative effect does it have on Java performance?

Does it actually improve performance, and if so how?

What's the effect on other platforms? (i.e. x86,mips,yadda,yadda,yadda...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天生の放荡 2024-08-03 12:29:08

是的,Dalvik 让 Jazelle 毫无用处。 唯一的问题是 Jazelle 一开始有用还是 90% 是营销炒作? 一个好的 JIT 或 AOT(提前)编译器往往比尝试使用专门的指令提供更好的性能。 Dalvik 基于寄存器的方法可能比传统的 java 字节码解释器更快,但解释器和 JIT 之间的差异很小。 希望 Android 的下一个版本具有 JIT。

编写一个具有最先进的垃圾收集器和优化器的优秀虚拟机大约需要 5 到 10 年的时间。 Sun(和微软)度过了那些年。 谷歌还没有。 希望他们能够继续对其进行投资,以便有一天 Android Java 代码不会比应有的速度慢 90%。

Yes Dalvik makes Jazelle useless. The only question is was Jazelle useful to begin with or is it 90% marketing hype? A good JIT or AOT(ahead of Time) compiler tends to give much better performance than trying to use specialized instructions. The register based approach of Dalvik might be faster than a traditional java bytecode interpreter but if the difference in minor between that of an interpreter and that of a JIT. Hopefully one of the next versions of Android has a JIT.

It takes ~5-10 years to write a good virtual machine with state of the art garbage collectors and optimizers. Sun (and Microsoft) have spent those years. Google hasn't. Hopefully they will keep investing in it so that one day Android Java code isn't a 90% slower than it should be.

尛丟丟 2024-08-03 12:29:08

维基百科:Dalvik 虚拟机

与大多数虚拟机和真正的 Java VM(堆栈机)不同,Dalvik VM 是基于寄存器的架构。

Dalvik 针对低内存要求进行了优化,具有一些区别于其他标准 VM 的特定特征:

  • 虚拟机被精简以使用更少的空间。
  • Dalvik 没有即时编译器。
  • 常量池已修改为仅使用 32 位索引以简化解释器。
  • 它使用自己的字节码,而不是 Java 字节码。

此外,Dalvik 的设计使一台设备可以高效地运行多个 VM 实例。

编辑:参见维基百科:开放手机联盟。 创始成员包括英特尔、摩托罗拉、高通和德州仪器。 一年后,ARM 在 2008 年 12 月加入。因此,我认为这些公司在当时还不是会员时依赖专有技术是没有意义的,因为它们的目标是创建开源 iPhone/Blackberry 竞争对手。

Wikipedia: Dalvik virtual machine:

Unlike most virtual machines and true Java VMs which are stack machines, the Dalvik VM is a register-based architecture.

Being optimized for low memory requirements, Dalvik has some specific characteristics that differentiate it from other standard VMs:

  • The VM was slimmed down to use less space.
  • Dalvik has no just-in-time compiler.
  • The constant pool has been modified to use only 32-bit indexes to simplify the interpreter.
  • It uses its own bytecode, not Java bytecode.

Moreover, Dalvik has been designed so that a device can run multiple instances of the VM efficiently.

Edit: See Wikipedia: Open Handset Alliance. The founding member includes Intel, Motorola, Qualcomm, and Texas Instruments. ARM joined an year later in December, 2008. So, I guess it didn't make sense for these companies to rely on a proprietary technology by then non-member, when the goal was to create opensource iPhone/Blackberry competitor.

对你而言 2024-08-03 12:29:08

实际上,我的印象是 Dalvik 更多的是为了空间效率而不是执行效率。 也来自维基百科:

未压缩 .dex 文件的大小通常比从相同 .class 文件派生的压缩 .jar(Java 存档)小几个百分点。

虽然当前的手机可能使用支持 Jazelle 的 ARM,但未来情况不一定如此。

同样来自维基百科(警告:道听途说):

已发布的规范非常不完整,仅足以编写可支持使用 Jazelle 的 JVM 的操作系统代码。 声明的意图是只有 JVM 软件需要(或允许)依赖于硬件接口细节。 这种紧密的绑定有助于硬件和 JVM 能够共同发展,而不会影响其他软件。 实际上,这使 ARM Holdings 对哪些 JVM 能够利用 Jazelle 具有相当大的控制权。 它还阻止开源 JVM 使用 Jazelle。

一旦他们向 Dalvik 添加 JITter,这一切都将成为一个有争议的问题。

I was actually under the impression that Dalvik was intended more for space efficiency than execution efficiency. Also from Wikipedia:

An uncompressed .dex file is typically a few percent smaller in size than a compressed .jar (Java Archive) derived from the same .class files.

While the current phones may use an ARM with Jazelle support, that's not necessarily true going forward.

Also from Wikipedia (warning: hearsay):

The published specifications are very incomplete, being only sufficient for writing operating system code that can support a JVM that uses Jazelle. The declared intent is that only the JVM software needs to (or is allowed to) depend on the hardware interface details. This tight binding facilitates that the hardware and JVM can evolve together without affecting other software. In effect, this gives ARM Holdings considerable control over which JVMs are able to exploit Jazelle. It also prevents open source JVMs from using Jazelle.

Once they add a JITter to Dalvik, it will all be a moot point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文