Skip to content

perf(robot-server): Optimize adding many offsets at once through POST /labwareOffsets#17952

Merged
SyntaxColoring merged 1 commit intochore_release-8.4.0from
optimize_offset_insertion
Apr 1, 2025
Merged

perf(robot-server): Optimize adding many offsets at once through POST /labwareOffsets#17952
SyntaxColoring merged 1 commit intochore_release-8.4.0from
optimize_offset_insertion

Conversation

@SyntaxColoring
Copy link
Copy Markdown
Contributor

@SyntaxColoring SyntaxColoring commented Apr 1, 2025

Overview

An HTTP client can upload multiple labware offsets to the robot server in a single POST /labwareOffsets request. Formerly, each offset was running in its own SQL transaction, which was slow. This wraps all of the insertions in a single transaction, which is much faster, in addition to being more atomic.

Inserting 1000 offsets on an OT-2 goes from ~210s (~210ms/offset) to ~22s (~22ms/offset).

Test Plan and Hands on Testing

We're covered by existing automated tests, but I also tried this manually on an OT-2.

Review requests

None in particular.

Risk assessment

Low. Changes are pretty trivial.

@SyntaxColoring SyntaxColoring requested a review from a team April 1, 2025 18:32
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner April 1, 2025 18:32
Copy link
Copy Markdown
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

cool cool!

@SyntaxColoring SyntaxColoring merged commit c0c9894 into chore_release-8.4.0 Apr 1, 2025
12 of 13 checks passed
@SyntaxColoring SyntaxColoring deleted the optimize_offset_insertion branch April 1, 2025 19:28
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