I recently adapted Numbered Disambiguation Choices by Aaron Reed to support rooms as well as things, and noticed that this line causes a substantial performance hit:
Understand the disambiguation id property as describing a room.
(The disambiguation id is a number property that every room and thing has.)
I was wondering if anyone could shed some light on why this is so slow, and if anyone has any ideas about how to make it faster. I guess it causes a lot of extra work for the parser. Would it be possible to somehow use a dictionary word address rather than a number, and then create dictionary words for, say, ‘1’ to ‘20’, unless they already exist?
EDIT: I tried replacing the line above with a lot of
Understand "1" as a room when the disambiguation id of the item described is 1.
and so on, but that turned out to be much slower.