State machines are generated as switch/case constructs, so they're both fast and memory efficient. States can be nested indefinitely and conform to the UML2 semantics.
Before you use state machines in your code, please read the chapter Structure Definitions!