Skip to content

ltlopes#15

Open
ltlopes wants to merge 1 commit into
mpage:mainfrom
ltlopes:main
Open

ltlopes#15
ltlopes wants to merge 1 commit into
mpage:mainfrom
ltlopes:main

Conversation

@ltlopes

@ltlopes ltlopes commented May 15, 2026

Copy link
Copy Markdown

Submission Checklist

  • My file is named submissions/<github_username>.py.
  • My submission runs locally.
  • My output matches the expected output.
  • I did not hardcode the final output.

Approach Description

Producer–consumer with a single scheduler thread.

Workers (ThreadPoolExecutor) only run target.build(...) and push (name, result) onto a SimpleQueue.
Main thread is the only scheduler: drains the queue, decrements in_degree, submits newly-ready targets.
No locks on the hot path — in_degree, results, and dependents are touched only by the main thread; the queue handles cross-thread handoff.

Fast path: If the graph is a pure chain (1 root, every node has ≤1 dep), skip the pool and build in-line. Avoids thousands of thread dispatches.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Results

Metric Value
Speedup 5.703234279106341x
Passed true
Graphs 5

Per-graph results

Graph Speedup Status
chain.json 1.0103106387218372x
diamond.json 11.832600686673837x
realistic.json 20.732505772015333x
tree.json 17.066836743700687x
wide.json 17.56055205380378x

View the leaderboard

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.

1 participant