Slow programming tasks

I’m interesting in collecting a bunch of different programming tasks which currently take a long time to complete, for an experiment. (Actually a performance test suite.) So if you have any examples, please share them!

I assume you mean “a long time for the program to run”, not “a long time to write the code”. :slight_smile:

My usual of-thumb test is starting up Reliques of Tolti-Aph, and then taking the first move (“east”) in that game.

Along those lines, loading up King of Shreds and Patches, starting the game, and pressing “i” to take inventory.

Excellent, keep them coming. Another is the Smarter Parser with it’s many regexs.

Just to check, are you both considering only the time taken to process those commands, or also the time required by those games when they start up?

My plan for the benchmark script is to have a number of tasks which are run as many times as possible in the test’s time limit, which I’ll probably make quite large, maybe even a couple of minutes per task. It won’t be comprehensive, but I would like to try to collect as many real world examples of slow code as I can. Eventually maybe we can add some Glk stuff too.

The aim will be to know what to improve so we can make both interpreters smarter and code more efficient. Expect more function acceleration in the future :slight_smile:

I ran into seconds-long pauses in Parchment due to my inventory code in Fragile Shells. Originally I was building the list using definitions and phrases like “[a list of inventoried not-suit-clipped large things carried by the player]”, but switched to building the lists via looping over all inventory items and hand-sorting them. The code in question is in Volume 2 Chapter 4 of ifarchive.heanet.ie/if-archive/g … Shells.txt. Uncomment the auto-list-building code, purloin several of the items (the nozzle, the stick pad, the crowbar, and the chain should do nicely), and take inventory.

Thank you. Inventory slowness seems quite common, and probably the same thing happens with King of Shreds and Patches. You’ve provided source code though :slight_smile:

Pathfinding over large maps gets rather slow, although this is probably to be expected. Blue Lacuna has a map area of about 90 rooms which was unacceptably slow for pathfinding over: I eventually created a static lookup table to hard-code pathfinding between the relevant rooms (possible due to the fact that the NPC in question was moving over a limited sub-set of them). It’s probably a lot more trouble than you’re looking for, but if you recompiled Blue Lacuna with the “if there is a dest of destination in Table of PPF” block commented out, you’d be back to significant pathfinding delays whenever Progue is moving.

Probably better suited for your purposes would be to procedurally generate a map of a few hundred rooms with random interconnections and have NPCs randomly pathfind over it.