Inline Functions

bearophile bearophileHUGS at lycos.com
Tue Feb 24 08:05:33 PST 2009


Mason Green:

>I'm looking for ways to optimize Blaze, the D port of Box2D, and running into some frustrations.  In fact, the same Java port (http://www.jbox2d.org/v2demos/) is currently running circles around Blaze, performance wise....<

In the beginning the Java code used to run very slowly, but today Java (and C# on dotnet) is getting closer to well compiled C++ code (and it's much simpler to write than C++).

A JavaVM like HotSpot is more refined than the backend of DMD, its GC is much more refined and more efficient, it's much better in inlining virtual methods, its data structures are usually better performance-tuned, etc. The D language is newer than Java, and it has enjoyed far less money, developers and users.

Have you profiled your D code? What has the profiling told you? Have you seen where you allocate memory, to move such allocations away from inner loops, or just reduce their number?

Bye,
bearophile



More information about the Digitalmars-d mailing list