Skip to content

Conversation

dstrain115
Copy link
Collaborator

@dstrain115 dstrain115 commented Sep 23, 2025

  • Currently, each streaming result refreshes the result.
  • This refresh is only needed to get the job finished time, which is not really used anywhere.
  • Forgoing this can reduce batch result times by ~200ms per batch item, which can be about a 3x for small circuits.
  • This PR makes the job_finished_time optional and does not populate it.

- Currently, each streaming result refreshes the result.
- Forgoing this can reduce batch result times by 3x.
@dstrain115 dstrain115 requested review from a team, verult, vtomole and wcourtney as code owners September 23, 2025 01:06
@github-actions github-actions bot added the Size: XS <10 lines changed label Sep 23, 2025
@github-actions github-actions bot added size: S 10< lines changed <50 and removed Size: XS <10 lines changed labels Sep 23, 2025
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (dbde273) to head (ee4290a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7662      +/-   ##
==========================================
- Coverage   99.37%   99.37%   -0.01%     
==========================================
  Files        1082     1082              
  Lines       96700    96689      -11     
==========================================
- Hits        96097    96085      -12     
- Misses        603      604       +1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

def __init__(
self,
*, # Forces keyword args.
job_id: str,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resource seems to map to a QuantumResult API resource, but the class doesn't contain the unique identifier for that resource - job_id is only unique within a QuantumProgram parent, which is only unique within a GCP project.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's a pre-existing issue, but I could add more fields while I am here. What else should we add, if anything?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project_id and program_id should be included as well and match the values in the parent EngineJob. Feel free to leave as a followup or file a bug since it's out of scope of this change if you aren't going to lazy load the timestamp of the job's completion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I will do that in a follow-up.

*, # Forces keyword args.
job_id: str,
job_finished_time: datetime.datetime,
job_finished_time: datetime.datetime | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used anywhere besides tests and places working around the requirement to set the field? Could we just remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally removed.

@github-actions github-actions bot added size: M 50< lines changed <250 and removed size: S 10< lines changed <50 labels Sep 23, 2025
def __init__(
self,
*, # Forces keyword args.
job_id: str,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project_id and program_id should be included as well and match the values in the parent EngineJob. Feel free to leave as a followup or file a bug since it's out of scope of this change if you aren't going to lazy load the timestamp of the job's completion.

@dstrain115 dstrain115 added this pull request to the merge queue Sep 23, 2025
Merged via the queue into quantumlib:main with commit 7b68c39 Sep 23, 2025
35 checks passed
@dstrain115 dstrain115 deleted the streaming_refresh branch September 23, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants