mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
minor eager prefixes improvements
- count eager prefixes as always run engine when comparing with smwr - only check if a prefix is vacuous after adding back literal fragments
This commit is contained in:
parent
e95a251935
commit
981b59fd05
@ -1274,9 +1274,6 @@ bool checkSuitableForEager(bool is_prefix, const left_id &left,
|
|||||||
if (proper_out_degree(g.startDs, g)) {
|
if (proper_out_degree(g.startDs, g)) {
|
||||||
return false; /* not purely anchored */
|
return false; /* not purely anchored */
|
||||||
}
|
}
|
||||||
if (is_match_vertex(g.start, g)) {
|
|
||||||
return false; /* vacuous (todo: handle?) */
|
|
||||||
}
|
|
||||||
|
|
||||||
ei.new_graph = cloneHolder(*left.graph());
|
ei.new_graph = cloneHolder(*left.graph());
|
||||||
auto gg = ei.new_graph;
|
auto gg = ei.new_graph;
|
||||||
@ -1284,6 +1281,10 @@ bool checkSuitableForEager(bool is_prefix, const left_id &left,
|
|||||||
|
|
||||||
ei.lag_adjust = decreaseLag(build, *gg, succs);
|
ei.lag_adjust = decreaseLag(build, *gg, succs);
|
||||||
|
|
||||||
|
if (is_match_vertex(gg->start, *gg)) {
|
||||||
|
return false; /* should not still be vacuous as lag decreased */
|
||||||
|
}
|
||||||
|
|
||||||
if (!can_die_early(*gg, EAGER_DIE_BEFORE_LIMIT)) {
|
if (!can_die_early(*gg, EAGER_DIE_BEFORE_LIMIT)) {
|
||||||
DEBUG_PRINTF("not eager as stuck alive\n");
|
DEBUG_PRINTF("not eager as stuck alive\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1234,6 +1234,11 @@ u32 roseQuality(const RoseEngine *t) {
|
|||||||
always_run++;
|
always_run++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t->eagerIterOffset) {
|
||||||
|
/* eager prefixes are always run */
|
||||||
|
always_run++;
|
||||||
|
}
|
||||||
|
|
||||||
const HWLM *ftable = getFLiteralMatcher(t);
|
const HWLM *ftable = getFLiteralMatcher(t);
|
||||||
if (ftable) {
|
if (ftable) {
|
||||||
/* TODO: ignore conditional ftables, or ftables beyond smwr region */
|
/* TODO: ignore conditional ftables, or ftables beyond smwr region */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user