Reconstruct https://github.com/looplab/fsm
(1) Up to 44.9% improvement of reaction speed from event to callback function.
go test -bench=. -run=none -benchtime=1s -benchmem -cpuprofile cpu.prof -memprofile mem.prof
2019-03-21T13:22:11.392+0800 DEBUG System init finished.
goos: linux
goarch: amd64
pkg: github.com/falconray0704/fsm/fsmBenchmark
Benchmark_falconFSM-8 1000000 1361 ns/op 387 B/op 12 allocs/op
Benchmark_loopLabFSM-8 500000 2473 ns/op 531 B/op 12 allocs/op
(1) Using int as key in callback and transition indexing.