Repository navigation
Conversation
The previous code uses the nice helper function that can handle various different forms of arguments (slices & negative numbers for stacks) that we don't use. Remove this indirection and assign the output directly. Additionally uses in-place modifications where feasible to avoid having to construct intermediate objects.
|
Well that's problematic because I don't think we should get a free pass. |
|
Probably not. It's an admittedly thin argument, but this is not OpenTTD itself - as far as I'm aware we do not have a org-wide policy. And sometimes, there is only one way of doing something |
|
If we don't then we should. It does not make sense to only apply to one piece. I am not going to mess about with definitions, exceptions or whatnot. |
|
Alright, fine. So... what do we do next? 2x parsing performance improvement isn't something that should be ignored. Presumably I can't do anything, as I'd just reproduce the above (but slower) |
|
Put it into perspective, we have literally one person complaining about build times, and their parsing time with Pypy without this change is 5.3 seconds. I don't think it's worth the taint. |
|
If the choice was as stark as project unity, or 2x parsing improvement, I'd pick project unity every time. |
Profiling
nmlcagainst the very, very largeiron-horse.nmlshows that a very large amount of time is taken in parsing the input. Not exactly a surprise as it's huge - somewhere around 80MB. But, it can be faster. My local testing indicates the 'parsing' phase drops from around 50s to 25s (with cpython 3.15). Which isn't bad.The main improvement comes from "unrolling" the PLY accessors in the first commit. It'll be partly due to a large of intermediate objects, and from the unrolling itself.
Very large disclaimer: This change was originally written by an LLM. I have since (hopefully) suitably torn it apart and rewritten as needed. Please review as brutally as you see fit.