-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce RAM usage; only allocate offset fields as needed
The AC, BM, and PCRE pattern structures each store a number of fields for offsets when, at least for AC patterns, the offsets are most often not specified (aka wildcard / any). This commit moves those values to a separate structure that is optional. If not specified, then the pattern will be treated as having a wildcard offset (any offset). I was also able to shrink the size of the `boundary` field from 4 bytes to 1 byte. Practically speaking, with today's databases, this appears to reduce RAM usage by about 39.22MB. It's not huge. But given I think this also improves the readability of the code, I'll call it a win.
- Loading branch information
1 parent
ca6c589
commit a4a0d35
Showing
16 changed files
with
537 additions
and
350 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
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
Oops, something went wrong.