There is some price to pay, but it's gonna vary wildly based on the quantity of different states (enableable comps) per entity, how homogenously the enabled components are spread out across chunks, how much data the states hold, how heavy the update logic is relatively to the baseline cost of iterating your state components, how often state changes happen, etc...
I had a test project for this which I'd have to dig up again. I implemented two state machines: one with a switch statement over a state enum, and one with enabled components. I measured the performance of both state machines in 2 different tests. In each test, each state holds an int value, and it increments that value when updated, and each state machine is given a random state on start and just stays in that state (so this test doesn't measure state change perf; only state update perf):
Test 1 - 1,000,000 state machines of 10 states each, updated 1 time per frame
- Switch approach: 2.7ms
- EnabledComps approach: 9ms
Test 2 - 10,000 state machines of 100 states each, updated 10 times per frame (simulates netcode prediction)
- Switch approach: 0.28ms
- EnabledComps approach: 1.61ms
Note: the pertinence of "updated 10 times per frame" is that it highlights the overhead of the enabledComps approach's scheduling of one job per state, as opposed to the switch approach's one job per stateMachine. At 10 updates per frame and 10 different states, switch approach schedules 10 jobs, while enabledComps approach schedules 100 jobs. Unfortunately I'd have to re-run tests to measure that overhead more specifically, because Test 2 also has more states per entity, which would also contribute to making the enabledComps approach slower than the switch approach. In Test 1, the EnabledComps are 3.3x slower than the switch, and in Test 2 they are 5.8x slower. So EnabledComps don't scale as well with state counts and update counts