Skip to content

⚡ Refactor Canvas Crawler fetches to run concurrently - #103

Closed
google-labs-jules[bot] wants to merge 1 commit into
mainfrom
performance-canvas-crawler-parallel-fetches-13465145031442609993
Closed

google-labs-jules[bot] wants to merge 1 commit into
mainfrom
performance-canvas-crawler-parallel-fetches-13465145031442609993

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

💡 What: Refactored crawlCanvasCourse to fetch Canvas course details and assignment lists concurrently using Promise.all(), replacing the previous sequential awaits. Both the .js and .cjs versions of canvas-crawler were updated to keep them in sync. Existing error handling semantics (e.g. throwing on course failure, catching on assignment failure) were preserved.

🎯 Why: The previous implementation awaited the course data response, then its JSON payload, and then initiated the request for the assignments list. Because these requests do not depend on each other, this sequential execution was highly inefficient and increased latency unnecessarily. Running them in parallel reduces the overall network wait time significantly.

📊 Measured Improvement:
A dedicated test benchmark was implemented with mocked 50ms network delay per fetch and 10ms JSON parsing latency, looping over the function 20 times.

  • Baseline: 2442 ms
  • Optimized: 1219 ms
  • Improvement: ~50% reduction in total simulated execution time, directly mapping to the elimination of the sequential network wait loop.

PR created automatically by Jules for task 13465145031442609993 started by @savvides

Modified crawlCanvasCourse in extension/background/canvas-crawler.js (and its .cjs counterpart) to fetch course details and assignments concurrently using Promise.all() rather than sequentially awaiting them. This maintains identical error-handling behavior while drastically reducing I/O-bound wait time. Tested via local benchmark and automated suite.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@savvides

Copy link
Copy Markdown
Owner

#109 rewrote crawlCanvasCourse to follow Canvas pagination and to fail loudly: a failed assignments request now stops the audit. This PR keeps the old behaviour of turning a failed assignments fetch into [], which made the course audit report a course with no assessments (finding F12 in #109). Duplicate of #94.

Closing as part of triaging the open PRs against #109, which restructures the extension (it removes the .cjs twins, renames test/test-*.js to .mjs, and rewrites the crawler and side panel). It is up to date with main as of ee79db2.

@savvides savvides closed this Sep 24, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

#109 rewrote crawlCanvasCourse to follow Canvas pagination and to fail loudly: a failed assignments request now stops the audit. This PR keeps the old behaviour of turning a failed assignments fetch into [], which made the course audit report a course with no assessments (finding F12 in #109). Duplicate of #94.

Closing as part of triaging the open PRs against #109, which restructures the extension (it removes the .cjs twins, renames test/test-*.js to .mjs, and rewrites the crawler and side panel). It is up to date with main as of ee79db2.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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