Author Topic: DFA optimization  (Read 1156 times)

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 587
  • Liked:
  • Likes Given: 0
DFA optimization
« on: December 02, 2019, 08:32:34 AM »
If you use a DFA in your program, then let the debug version count how many times you arrive in each state. Then sort your comparisons (especially if you use a switch statement).

I did this with a DFA with 9 states and my program suddenly worked 4 times faster.