-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make Engine without lifetime. #613
Labels
Milestone
Comments
Tagging @V0ldek for notifications |
github-actions
bot
added
acceptance: go ahead
Reviewed, implementation can start
and removed
acceptance: triage
Waiting for owner's input
labels
Dec 20, 2024
V0ldek
added a commit
that referenced
this issue
Dec 22, 2024
…query The `Automaton` struct borrowed the source query, which also caused the Engine to carry the query's lifetime with it. The actual data being borrowed were the `JsonString` values for member transitions. In preparation for #117 we remove the borrowed `JsonString` and replace it with `StringPattern`. For UTF-8 the `StringPattern` will be a more complex struct that precomputes some stuff for efficient matching later. For now, it's a thin wrapper over a `JsonString`. During construction we may create many transitions over the same pattern. To reduce the size of the automaton we cache the patterns and put them into an `Rc`. This may get optimised later to instead use some kind of inline storage, but it's unlikely to actually matter. I ran the benchmarks and saw no measurable difference between the previous version and this one. Refs: #117 #613
3 tasks
V0ldek
added a commit
that referenced
this issue
Dec 22, 2024
…g-pattern Added StringPattern and made Automaton no longer borrow the query
github-actions
bot
removed
the
acceptance: go ahead
Reviewed, implementation can start
label
Dec 22, 2024
This is released in v0.9.2, |
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I need to store compiled once engines in struct
but engine should keep reference with lifetime to query.
Is it possbile to make special Engine that pass query by value once and compile it to engine, and then use just engine to handle incoming json?
The text was updated successfully, but these errors were encountered: