Author Topic: DFA optimization  (Read 2759 times)

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
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.

 


SimplePortal 2.3.6 © 2008-2014, SimplePortal