But since Java is compiled into native code by JVM, all it really matters with speed is how much code and how fast it precompiles, right? Of course there are other differences, but the biggest one would be the actuall compilation.
有几点我不会立即忽略。一方面,Java 规范要求在每次访问数组元素之前,运行时必须检查索引是否有效,即 0 <= index && index < array.length。 .我想视频解码将大量使用数组,因此 Java 数组可能不是该任务的最佳选择。
But they say Java is too slow to even paint those 30 FPS even HD Ready images. But why? I always thought that JVM uses the fastest method available to get its window in OS, and than manipulating its content internally. And if I pressume Java is fast enough (meaning C++ like) when JVM is "warmed", where is the problem with displaying images? all JVM has to do in that case is to write array to OS specific display output, right?
咳咳……我不会将 Java 2D API 的默认渲染器称为高效的。至少在我的计算机上,通过 JOGL 直接调用 Open GL 比使用 JDK 提供的 API 效率最高(大约 10 倍)。我怀疑工作中软件和硬件渲染之间的差异......但这主要不是语言的错误,而是它的标准库的错误。任何头脑正常的人都不会在没有硬件加速的情况下制作高性能图形,无论使用何种编程语言。