"Update chronological records" slow in large Glulx game

Hi. I’m making a large, complex mystery game in Inform 7 for Windows (6M62), which I hope to eventually release on the web via Quixe.

In my most recent release-for-testing build, I ran into a noticeable performance bottleneck. Every time a new command prompt was printed, there was a noticeable processing delay – 1 second on my browser, and “freezing” my friend’s browser (which was running on a gaming laptop with very respectable specs). Some trial and error eventually narrowed the culprit down to the “update chronological records rule,” which was taking an extremely long time to run on Quixe – far longer than Glulxe or Inform 7 built-in interpreter.

Now, I don’t know what the “update chronological records rule” actually does. I’ve tried looking at the Standard Rules, but all it tells me is that it corresponds to something in the Inform 6 guts of the IDE. My best guess is that it deals with creating a history of the game world for the purpose of “past and perfect tenses,” as described in Writing for Inform §9.13. My game has 786 objects and counting, so I can see how systematically checking every single variable and property in the game world for changes might be a problem.

Obviously, I can’t ship my game with a performance bottleneck on this scale. My question is, is there any way to make my game run at a reasonable pace in Quixe? If not, will it break anything if I unlist the rule from the turn sequence rules and rewrite my code to compensate for the loss of past-and-perfect-tense functionality?

The curse of the update chronological records rule is that it takes time proportional to the number of past-tense relation conditions in your game. All it does, at root, is go down that list and check which conditions are true this turn.

(A past-tense relation condition is one that looks like “if the box was open” or “if the box has been open”. Action conditions like “if we have opened the box” are handled elsewhere.)

So if you go through your code and remove all those conditions, you don’t have to unlist the rule, because it will become a no-op.

However, you probably don’t have to remove all those past-tense conditions. There’s probably just one, or a handful, that are much slower than the others. For example, “if all containers were open” is slower than “if the box was open”, because it has to check every container every turn.

Unfortunately this means a lot of peering through your code and thinking about what’s slow. We have experimental profiling tools for Inform, but they are not easy to use and they work at the I6 level.

Thanks. In my most recent update, I added eight checks for the noun and second noun part of the current action every turn (!). Removing those, and every other instance of the past tense, makes the game run much faster.