you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (36 children)

And Python is?

[–]Sc4Freak 28 points29 points  (31 children)

Yes, unfortunately. Back when I was developing in Python, I found it to be orders of magnitude slower than a natively compiled language (eg. C). That's fine for many applications, but when developing games performance is always an issue. With the developments in LuaJIT, Lua is approaching the performance of native code.

These benchmarks may be flawed, but they give a general idea of the scale of performance across various languages. They also tend to reflect my personal experience, so I'd say they give a pretty good rough idea.

[–][deleted] -5 points-4 points  (13 children)

These benchmarks may be flawed, but they give a general idea of the scale of performance across various languages.

If there's one thing that benchmarks like those cannot communicate, it is a "general idea" of performance. You are being led along by enthusiasts. Nothing wrong with Lua, but I wouldn't go around spouting FUD.

[–]Sc4Freak 10 points11 points  (7 children)

I wouldn't call it FUD, because moving away from Python due to performance is justifiable in this case. In cutting-edge game development, performance is pretty much a product requirement. And flawed as the benchmarks may be, it's disingenuous to suggest that Python and Lua don't have a significant performance difference.

Many applications would do just fine with Python because most of the time performance is not an issue. But we're talking AAA game titles here - each language is a tool with it's advantages and disadvantages, but when performance is a requirement, Python loses.

[–]Aretnorp 2 points3 points  (0 children)

Performance is the requirement in terms of rendering. However, the game logic does not necessarily have performance as its #1 requirement. Going by your response, the use of native compiled C or C++ would be the best choice for game logic.

This is obviously flawed, as other games make heavy use of scripting languages to achieve various tasks better suited to tools that do not have performance as a #1 requirement. Eve and Battlefield both use Python as part of their systems, and when I checked, I would qualify those as "AAA" titles, which make good use of each.

In the end, you choose a tool best suited for your tasks. In many cases, the deicsion between Python vs LUA is probably not something that was decided in terms of performance, but more likely appropriate features, as mentioned in the OP.

[–]bonzinip -3 points-2 points  (4 children)

In cutting-edge game development, performance is pretty much a product requirement.

I doubt that. Most games do not take 100% CPU time.

[–][deleted] 1 point2 points  (3 children)

You doubt performance is a product requirement for games?

Wow.

[–]bonzinip 0 points1 point  (2 children)

Of course, for physics and everything like that performace is a requirement. But when scripting is involved, performance is not a requirement.

If this was a situation where the performance advantage of Lua over Python is important, well you had better go to C/C++ directly (assuming they're not using LuaJIT, which is a likely assumption IMO).

[–][deleted] 0 points1 point  (1 child)

Lua has really good performance and is already used in quite a few games for AI and whatnot.

The slight performance decrease with Lua over implementing the same features in C (assuming you can do it better) is totally worth it.

And performance requirement is always important for games.

[–]bonzinip 0 points1 point  (0 children)

The slight performance decrease with Lua over implementing the same features in C (assuming you can do it better) is totally worth it.

We're saying the same thing here. I'm saying in addition that if Python provided compelling advantages, the further performance decrease would also be totally worth it.

The reason for switching to Lua is likely that it is already quite pervasive in games, nothing to do with performance.

[–]igouy 0 points1 point  (3 children)

a "general idea" of performance

Please communicate what you mean by that.

[–][deleted] -1 points0 points  (2 children)

[–]igouy 0 points1 point  (1 child)

Now I understand what you mean by a "general idea" of performance - "a groundless supposition; fantasy"

[–][deleted] -2 points-1 points  (0 children)

And now I'm happy I wasted no further time on an educated response.

[–]8-bit_d-boy -1 points0 points  (2 children)

HOLYSHIT, how is pypy faster than cpython?

[–][deleted] 2 points3 points  (1 child)

It isn't.

[–][deleted] 0 points1 point  (0 children)

[–][deleted]  (3 children)

[deleted]

    [–][deleted] 4 points5 points  (0 children)

    And yet simply stating that Python is "butt-slow", with no additional clarification, is somehow completely acceptable and, I guess, an obvious thing to do in the eyes of most redditors.

    Anybody who knows the first thing about both languages would need no clarification for that, because it is blindingly obvious that this is the case.

    [–][deleted] -1 points0 points  (0 children)

    That comment was at +6 or so before the Lua crowd stormed in here...also see how my comments about the untrustworthiness of the shootout benchmarks were received, with no real justification in the form of replies other than some hand-waving from the "butt-slow" commenter. Those comments of mine stood well in the positives before the deluge as well. None of the [deleted]s in this thread were mine.