|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> 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
|
![](/i/fill.gif) |