Pilk
Blade.
|
Posted - 2009.04.16 12:14:00 -
[1]
Originally by: Amida Ta
Originally by: Backdaft Amida, I'm not familiar with cPython but I do know many higher level languages compile down into C first. Many are highly efficient at this and I suspect any slow downs are minimal -probably less than 5% if I had to guess.
5% would not even be worth to mention. However cPython is WAY slower than that. Compared to C/C++ (e.g. Intel or GCC) cPython can easily be 100fold slower for computationally-heavy tasks. In extreme cases even much more than that. As a rule of thumb in general it will be around 10times slower (that is 1000%).
Originally by: Backdaft
Java is designed to run on all computers by compiling down to a generic bytecode, so until computers have processors that can run the bytecode in hardware, I'd guess Java would be slightly slower. And .Net is all about libraries and reusable code, so if you're not careful you end up with a massive executable, and I suspect some of those libraries can bog you down really bad -so much slower.
Java and .Net are both in the same ballpark. Sometimes they are even faster than C, but as a general rule of thumb you can assume that they are about 30% slower.
Originally by: Backdaft
And assembly always wins
Sure, but the difference between hand-tuned assembly and e.g. C++/.Net isn't that big any more.
You're missing the point, but first I'll address a separate issue--Java compiles to bytecode, yes, but then that bytecodes has been run (since the mid-90's) on a HotSpot-style JVM. That means that, in tight loops, Java's performance exactly equals that of C (which in turn would exactly equal the performance of machine code).
Anyway, it's just as edifying to say, "EVE would run 100,000 times faster on custom silicon instead of generic Intel." While it's doubtless true that some of the tighter code would benefit from being written in a lower-level language, it's an enormous investment of time to retrain dozens of programmers, and not all of them would get it Right (tm). So, let's say you lose 30% of performance by running through CPython. How much do you lose when a novice C programmer implements a terrible sorting algorithm, because unlike in Python, he doesn't have a standard API that includes a good one? How many features do you lose when an expert C programmer spends more time writing bounds-checking code on all his functions than actually providing functionality?
The question isn't whether EVE could be faster if written in a different language, it's whether EVE could: a) exist at all, and b) be better if written in a different language. And given CCP as a backdrop (i.e., not disputing, there are companies out there with the tool- and skillsets already in place that could write an EVE from scratch in C, or SmallTalk, or pure lambda calculus), I think Stackless is the language of EVE going forward.
Now, that said, my understanding is that CCP already looks at tight loops within the game and recodes and recompiles them into PIC that they call from within Python. So they get most of the benefits of a low-level language, at a fraction of the cost.
Honestly, the only thing I would change about CCP's coding environment is to make them understand that an hour of downtime every day is a sign of weakness. Hire four spectacularly-good Stackless programmers and assign them to nothing but cleanup and rewriting duty. Inside of a year, you'll never need to reboot the platform.
--P
Kosh: The avalanche has already started. It is too late for the pebbles to vote. Tyrrax's bet status: PAID! |