-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: speed up fgComputePreds (#35352)
Interaction of `fgComputePreds` and `fgAddRefPred` could be quadratic in the number of preds. Usually the number of preds is small (1 or 2) but in some cases seen from compiled regular expressions it could be in the thousands. On one such case a single call to fgComputePreds was taking ~20% of jit time. Since we build the pred list in sorted order we can take advantage of this to avoid searching the list for potential duplicates in `fgAddRefPred` when it is called from `fgComputePreds` -- the only possible duplicate entry is at the end of the list. This doesn't address perf of subsequent calls to `fgAddRefPred` but likely those happen somewhat randomly and are unlikely to be as costly.
- Loading branch information
1 parent
a8476a1
commit af36c6d
Showing
2 changed files
with
65 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters