News for hackers. Stuff that matters.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by hermitdev on Tuesday March 07, 2023 @12:11PM (#35057927)
The Civ4 core game dll was its own bottleneck. It's is terribly inefficient c++. Years ago, I was working on my own mod to optimize it because I got tired of waiting 15 minutes for the AI to complete a turn on a huge map late game. It was not hard to get it down to just a few minutes. I think it could be used as a poster child for a code base written by someone expecting the optimizer to work miracles. Lots of macros hiding expensive call chains used in tight nested loops, repeated calls in loops to get the same item that should have been called once outside of the loop(s), etc.

Python was not the bottleneck, just the scapegoat for badly written code.

Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by brucethemoose2 on Tuesday March 07, 2023 @02:54PM (#35060304)
Yes, but (AFAIK) Python itself also became a bottleneck in the Civ4 gigamods, like the (still active) Caveman2Cosmos.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by nurettin on Tuesday March 07, 2023 @04:03PM (#35061172)
How did you even start optimizing Civ4? Did you replace some exported dll functions with your own? How did you access the state in memory?
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by hermitdev on Tuesday March 07, 2023 @06:48PM (#35063111)
Firaxis provided the source for the core DLL for modding. Don't recall exactly when, but it may have been with the Beyond the Sword expansion.