POV-Ray : Newsgroups : povray.off-topic : Interesting performance comparison of C#s and C++'s : Re: Interesting performance comparison of C#s and C++'s Server Time
29 Jul 2024 18:21:36 EDT (-0400)
  Re: Interesting performance comparison of C#s and C++'s  
From: Warp
Date: 22 Jun 2011 15:28:30
Message: <4e024258@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Sure. And on the third hand, what's typical in a language gets optimized in 
> that language. It's typical for virtual functions to not go through a 
> dispatch table in Java if they don't actually have any other class 
> overriding them, while C++ can't generally manage this. So it's "typical" to 
> not make things virtual in C++ that are virtual in Java, but Java optimizes 
> that bit and C++ doesn't.

  OTOH the slowness of virtual function calls (vs. regular function calls)
is often greatly exaggerated, based solely on presuppositions rather than
actual mesurements.

> For example, it's also "typical" (or at least getting typical) for the Java 
> compiler to optimize out heap allocations (i.e., turn "new" into an alloca() 
> sort of operation) in ways that C++ would never try.

  I wonder when they will add scope-bound objects to Java.

  First Java wanted to get as far from C++ as possible. It's slowly drifting
towards it.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.