Skip to content

Replace meta-rule full-rescan retry with a dependency-driven work queue#32

Open
bigio wants to merge 2 commits into
apache:trunkfrom
bigio:speed_meta_retry
Open

Replace meta-rule full-rescan retry with a dependency-driven work queue#32
bigio wants to merge 2 commits into
apache:trunkfrom
bigio:speed_meta_retry

Conversation

@bigio

@bigio bigio commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

do_meta_tests() restarted its entire foreach over meta_check_ready (or meta_pending when finishing) via "goto RULE" every time any meta resolved, re-checking the dependency list of every still-pending meta each time, even ones unaffected by what just resolved. Replace it with an explicit work queue seeded the same way, where resolving a meta pushes only the specific metas listed in its meta_deprules reverse-map (the same map PerMsgStatus::rule_ready() already uses) instead of rescanning everything.

do_meta_tests() restarted its entire foreach over meta_check_ready (or
meta_pending when finishing) via "goto RULE" every time any meta
resolved, re-checking the dependency list of every still-pending meta
each time, even ones unaffected by what just resolved. Replace it with
an explicit work queue seeded the same way, where resolving a meta
pushes only the specific metas listed in its meta_deprules reverse-map
(the same map PerMsgStatus::rule_ready() already uses) instead of
rescanning everything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fkoyer

fkoyer commented Jul 22, 2026

Copy link
Copy Markdown

Looks good to me except you should either seed the hash with truthy values:

my %queued; @queued{@queue} = (1) x @queue;

or check for existence:

next if exists $queued{$deprule};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants