2 ms·
Code transformers are more general than macros and I focused on one way to use them. I disagree that they're an optimization in this example, since the original
by skybrian 12y ago
Code transformers are more general than macros and I focused on one way to use them. I disagree that they're an optimization in this example, since the original code isn't being transformed but rather overridden with a separate implementation. It's more like overriding a method in a subclass; the intent is probably for the implementations to have equivalent behaviors, but the details differ and there can be bugs.
Just like when a method is overridden, the reader should be able to see that there are multiple implementations and understand how they work. If you want to understand performance, you need to look at the production implementation.