Skip to content

fix: skip AutoGraph verbose-logging calls when verbosity is disabled#107

Merged
rmshaffer merged 3 commits into
mainfrom
rmshaffer/skip-verbose-logging
May 4, 2026
Merged

fix: skip AutoGraph verbose-logging calls when verbosity is disabled#107
rmshaffer merged 3 commits into
mainfrom
rmshaffer/skip-verbose-logging

Conversation

@rmshaffer
Copy link
Copy Markdown
Contributor

@rmshaffer rmshaffer commented May 4, 2026

Issue #, if available:

Description of changes:

Short-circuits AutoGraph's verbose-logging call sites when verbosity is off, avoiding the cost of formatting log messages that would be discarded. Improves performance of @aq.main compilation of larger programs by roughly 10%, where unnecessary logging was happening on every single transformation.

Includes another unrelated performance optimization to cache the results of get_args(QubitIdentifierType).

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d143092) to head (a4f0534).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #107   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2161      2163    +2     
  Branches       251       250    -1     
=========================================
+ Hits          2161      2163    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rmshaffer rmshaffer marked this pull request as ready for review May 4, 2026 17:50
@rmshaffer rmshaffer requested a review from a team as a code owner May 4, 2026 17:50
@rmshaffer rmshaffer merged commit 1b993e4 into main May 4, 2026
18 checks passed
@rmshaffer rmshaffer deleted the rmshaffer/skip-verbose-logging branch May 4, 2026 20:37
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