Compilation efficiency

I was just wondering about rules and pieces of code that are in your source, or the standard rules, but don’t end up being referenced by your game at all when you compile it. Does the compiler just jettison them? Or can you benefit from cleaning things up a bit yourself?

A couple of examples I was thinking of:

  • Maybe you paste in some big table of glulx styles, and a lot aren’t used. I’m guessing Inform has to include those anyway cos you put them in a table? I assume the result is a peanuts increase of some bytes or kb in file size, and no efficiency change.

  • How about if you axe lots of standard commands with 'understand as something new’s? Are all of their rulebooks still compiled? Or only if those rules are referenced by other commands or programming? This is probably what I’m more interested in for something I’m working on.

As far as I know, you gain nothing back by not referencing them (just as you gain nothing back from unlisting a rule, etc). I think the core machinery compiles as-is, no matter how much of it is used.

I wish it were otherwise, but I think that’s the case. I never use (for example) standard Inform doors … not a single one, but I think the mechanics for them are contained in any game I compile, anyway. I have the vague impression that it’s all pretty tightly bound, and not “modular” in a way that would allow chunks to be safely and neatly dropped out.

On the other hand, this is actually my ass typing. It’s what I speak out of when it comes to technical matters.

The translated I6 is not as hard to understand as you might think - most of the original I7 code is still there within the comments - so it’s possible you could search auto.inf to see which rules are there.

Even a stopped ass is right twice a day. Ghalev’s is correct. If you want to nix stuff for significant memory regain, you ought to use section replacement or, most likely, replace sections out of the various i6t files. But neither are really intended for everyday folk.

Which raises the question: what features do you find indispensable? I created a version of I7 so stripped down it was basically I6, and then started adding bits back to it piecemeal. Like, the “say” statement, which is always handy…

I’ve always wanted to know where exactly the intermediary I6 code is placed before compilation. Are you saying it’s stored somewhere?

It’s in the project folder under Build/auto.inf. (On a Mac, you’ll have to use the “Show Package Contents” finder option to open the project folder.)

Want :frowning: :frowning: :frowning:

Oh yes, it’s kept at yourproject.inform/Build/auto.inf

Of course there can sometimes be issues with the path, at least on the Mac. If I open auto.inf in MacVim and then recompile, MacVim is unable to find the new version of the file because the entire directory has been deleted and rewritten.

If there are compilation errors, you can sometimes view the i6 source within the IDE under the Errors tab. I can’t remember if it’s in the “Progress” or “Inform 6” sub-tabs.

Ah, right. I never realized; apparently it’s erased the moment you exit the application. Thanks for the heads-up.

In Preferences -> Advanced, there’s a checkbox labeled “Clean build files from projects before closing.” Uncheck it.

Awesome. Thank you kindly.

As you wish. But if you pride yourself on being non-technical, you may lose your sense of pride. Here’s what it can’t do: actions, objects, properties, activities, relations, and I haven’t tested scenes so probably not that either. Here’s what it can do: ask if a piece of text “has been said” (this isn’t robust, but it works); compiles to a Z-code game about 2K in size, most of which is the I6 veneer; has basic bibliographic info; basic typography (bold, italic, highlight, newline); if-statements and say-phrases; uses “responses”, a kind of value, instead of objects (see the few Understand…as… lines); and getting input from the user is done from a say-phrase.

So you might have a rule like this: every turn, say "Yay or nay? [if yes]OK: [response][or no]Nope.[or anything else]What?" Since “yes”, “no”, and “anything else” are “responses”, it will stop writing prose to the screen at the “if”, get input from the reader, and then process the if-chain according to what the reader typed in. There’s also a variable, “the response”, which remembers what was typed in so you can save it away from later if you want.

Oh, there’s 11 rulebooks in the system only because I7 complains if any fewer exist. Only maybe 5 of them are used. See the code that follows the heading, “end New Standard Rules” for examples of how this tiny, tinny little thing can be used.

What does that do exactly? (Just out of curiosity)
Is there any drawback to it?

I’ve noticed text-only games in Inform compile quite quickly, whereas my project that uses Glimmr takes about 8-10 seconds and heats up the CPU a bit as it finishes.

Glimmr defines a lot of new phrases that it takes the compiler some time to resolve; that would be the main reason for slower compilation. However, 8-10 seconds is a lot longer than it takes on my machine (5-year old MacBook), and I also don’t think there’s any greater hit on the CPU. So maybe something else is going on there.

–Erik

Oh, I promise, that’s not something I’m proud of. I pride myself on what I’m good at (and what I’m wise enough to avoid); I have no bumpkin’s pride in my areas of ignorance :slight_smile:

But thank you, I will try to see what I can achieve with it :slight_smile:

My dream-version of I7 is basically the one that lives in the question that started the thread: a version that’s internally modular, and compiles only the bits you make reference to … so, if I put a door in the game, in goes the door stuff, along with the door. If I never mention a door, that stuff is left out. Etc.

An almost-as-awesome version would be a more stripped-down core with more things available as extensions.

I have no idea if this would even be feasible, since I know nothing of the guts inside the machine. But if anyone is working on either of those things, I’d of course volunteer time for testing, etc., to the extent that my limited understanding would allow me to contribute.

Maybe games which include a lot of graphics files take extra time to put the blorb together? I haven’t tested it myself.