Are there any performance penalizations because of this? The code for the state machine looks very complex and I'm curious about what's the difference in terms of performance between the pyramid model or the flat model.
Author here. Yes, there is a trade-off. The resulting code is much bigger than the original code because of this transformation. But, I think the trade-off is worth it because it makes the code simpler to read, write and maintain. As far as speed, I don't have any benchmarks but I don't think there is speed penalty. It's mainly an issue of code size.
[+] [-] sharkenstein|6 years ago|reply
[+] [-] hachibu|6 years ago|reply