[MUD-Dev] New Beginings
David B. Held
dheld at codelogicconsulting.com
Tue Jun 4 21:47:57 New Zealand Standard Time 2002
From: "Kwon Ekstrom" <justice at softhome.net>
> Actually JVM's are VASTLY improved, if you look at performance
> comparisons, primitive operations are withing nanoseconds of c++.
> Java's real slowdown is actually from overridden methods. I'm
> sure someone will tackle that problem shortly.
With templates? ;)
> I don't see how direct allocation will drastically improve my
> mud's performance. I simply cache my objects and don't pay the
> allocation fee repeatedly. I don't need to dump objects
> constantly so the GC isn't a major issue.
If your load is relatively stable, and doesn't spike, then caching
is a fine solution. But if you have any allocation spikes, you are
either going to end up with a fat, empty cache, or you're going to
wait for the GC to reclaim the unused objects all at once. With
refcounting, you pay for deallocation as soon as the object's
lifetime is over. The insignificant cost of adjusting the refcount
is more than justified by the optimal memory usage. And if you use
a pool allocator with a smart resource, you can have automagic
> The simple fact is, what performance gains I'd receive using C++
> are overcome by the development tools I get from java.
That's funny. C++ has a much broader user base and toolset. It's
also more mature, and has far more libraries than any other lanugage
I know of. I don't have anything against Java. It has a place in
the language marketplace. But I find it odd that tool choice is a
factor in preferring Java over C++.
> Cross-platform, extreme stability (short of a stack overflow, I
> haven't done anything capable of actually crashing my server),
Several compilers run on virtually every platform. And C usually
gets ported to every new platform before anything else does. I'll
admit that you can definitely do some dangerous stuff in C/C++.
With power comes responsibility. But it is certainly possible to
learn to write safe, robust code without going to any greater
lengths than other languages.
> My program has performance advantages of muds written in C by
> using inheritance models that cut out the need to do alot of the
> state checks that a purely proceedural mud would need (C++ has
> this advantage as well).
But lacks the performance improvements made possible by template
code, which allows for extensive inlining, and compile-time type
checking instead of runtime.
> You have to know what language you're writing in... the same
> techniques don't work in all languages.
Granted. Which is why I'm always suspicious when someone says that
<interpreted, GC language X> is "basically as fast as C++". The
person who wrote the benchmarks to "prove" that probably doesn't
know jack about C++.
MUD-Dev mailing list
MUD-Dev at kanga.nu
More information about the MUD-Dev