Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Java is faster! Date: Thu, 29 Sep 2016 21:24:17 -0400 Organization: Aioe.org NNTP Server Lines: 40 Message-ID: References: <1l9fub927k9tntoli9cddnfil6e4o74are@4ax.com> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:35669 On 9/25/2016 2:05 PM, j4n bur53 wrote: > Since Java is typesafe, and this typesafety goes > vary far, recently, after much time, I have > even created a runtime error when assigning > an array cell, so the component type of the array > didn't match the element type. > > I think there is a general limit. This typesafety > is still ingrained in the runtime. Although casts > are highly optimized, they don't go away. I recently > made some other experiments, and bumpted my head > speed wise just because of the many casts I needed. > > So if all is well typed, no casts and a lot of primitive > types, I guess you get speed. But if you use more > generic data structures, I see some problems just > because of the casts, although some caching techniques > are used inside the JVM.(*) This is probably mostly important in what was once labeled scientific computing (as opposed to business computing). In theory I think the JIT compiler could move a lot of the type checking outside of inner loops and thereby minimize the overhead. But there are probably some impact left. Also note that Java has never gained so much traction in scientific computing as in many other areas. I suspect that type check, array index check and lack of user defined value types play a role in that. Arne