Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More improvements to the DFA's inner loop. #205

Merged
merged 1 commit into from
Apr 22, 2016
Merged

More improvements to the DFA's inner loop. #205

merged 1 commit into from
Apr 22, 2016

Commits on Apr 22, 2016

  1. More improvements to the DFA's inner loop.

    There were two important changes:
    
      1. self.at is used sparingly in favor of a local `let at` binding.
         This seems to convince the compiler to use a register.
      2. Switch the transition table from a `Vec<Box<[StatePtr]>>` to a
         row-major `Vec<StatePtr>`.
    
    (2) is the juicier of the two. It makes more efficient use of the cache.
    In particular, a critical aspect is that a StatePtr points to the start
    of a row in the table, which enables indexing in the inner loop with a
    single ADD instruction. (i.e., `si + byte` instead of
    `si * #classes + byte`.)
    BurntSushi committed Apr 22, 2016
    Configuration menu
    Copy the full SHA
    09d1766 View commit details
    Browse the repository at this point in the history