[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing games in interpreted languages



Steve Baker wrote:

>> I disagree. The fact that Perl (or Python, Scheme, etc) code is
>> interpreted in software rather than being executed on an actual processor
>> just means that this particular piece of code will need a few more
>> processor cycles to be executed.
>
>A *few* more?!?  Try 50 times slower than C or C++ !!  (For python at least).

Perl isn't that bad. In "The Practice of Programming" there's a "benchmark"
of functionally identical Markov programs (random but more or less senseful
text generation) in different languages.
Plain C is clearly first (0.30/0.36 sec, 150 LOC)
Perl is second (1.0/1.8 sec, 18 LOC)
C++/STL is third (1.5/1.7 sec, 70 LOC)

After that come AWK (2.1/2.2 sec, 20 LOC) and Java (9.2/4.9 sec, 105 LOC).

The first time is PII/400/NT, the second R10000/250/Irix

The mileage on other problems (the Markov program plays on Perl's
strengths) may vary, but the values are nevertheless interesting.

	Christian
-- 

Drive A: not responding...Formatting C: instead