I7 : lists or table

In the Inform 7 extensions public library, there’s one called List Control by Eric Eve which combines tables with shuffling, cyclic or stopping behaviour. Don’t be thrown by the word ‘list’ - technically, it uses tables all the way.

In terms of computation, there’s no problem raising MAX_STATIC_DATA as often as is required. It’s more common to be worried about which method will execute slower, especially if you run the game online where such effects can be more pronounced. Offline they’re often invisible, unless you’re dealing with massive amounts of data.

I don’t think the benchmarking extensions work with the current Inform. I just know bits and pieces from anecdotes and from recent experiments of my own. My own test showed writing data to a huge list was considerably slower than doing so in a table with the same number of entries. I should have written this stuff down… you know, I did 100 and 1000 and maybe 10,000. Somwehere between 100 as we moved up towards 10,000, the list time overtook the table time very significantly. But that’s just building the list.

Someone else here recently showed that looking things up in tables, especially if items were near the end, was surprisingly taxing. But that may have only been a surprise relative to what was expected : )

My advice is that if you can’t detect a speed change offline, use whichever method you find most convenient. But what I’d do is build your game to a website and try it there (‘release along with an interpreter’). That wilI exaggerate the speed hits of various processes. Doing this showed me my extension couldn’t be run online without a 3 second interval between some turns, which motivated me to optimise and replace bits, and I got it down to a fraction of a second per turn online.

-Wade