Thursday, August 28, 2014

Abiathar Confidential: Not Fully a Placebo

People on PCKF have noticed that Abiathar's "High Speed Mode" menu option tends to not do a lot to improve speed. I sense suspicions growing that its purpose is simply to invoke the placebo effect.

This is more true than one might think.

Originally, when it was added (before full release), rendering was different. High Speed Mode suppressed extra re-renders, thereby improving performance. As rendering has been optimized, the HSM branch was actually removed because I didn't want to maintain two versions of stuff and that stuff was pretty good anyway. So, yes, its main purpose has vanished.

It also disables the undo feature. If you decompile the program, you'll notice that Response.FastMode is almost never actually checked when the core extension pushes items onto the undo stack. So, most of the time, it just saves some memory.

But there is a fairly important case where HSM actually does something: the row/column adjusters. Since the level's size has to be changed for these, the original level instance has to be thrown out. In preparation for performing the row/column adjustment, unknown infoplane items in the level are zeroed and copied into a temporary storage space, which is soon used to fix all the links. If I just shoved a reference to the old level into the undo task, you would lose most of your infoplane values when you undid an adjustment operation. This is probably not desirable. So, the adjusters make a deep copy of the level, which actually takes a bit of time. Since this would just get thrown away in HSM, the adjusters actually check to see if it is enabled, and if so, skip the cloning operation.

Finally, High Speed Mode suppresses most of the translucent selection rectangles. Their sizes and position are still calculated, but the blend operation doesn't have to be done because HSM marks that plane invisible. (Fun fact: before I added an override, enabling High Speed Mode would make the find tool totally useless because its effects were made invisible.)

So, there you have it. For normal tile-by-tile operations, Abiathar's High Speed Mode doesn't do anything. But in those special cases (and especially in that one), it does have a positive effect.

No comments:

Post a Comment