Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(robot-server): Avoid creating process pools that won't do anything #17173

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Dec 23, 2024

Overview

This optimizes a specific case of robot-server startup.

Details

One of our persistence directory migrations delegates some work to a process pool, for parallelization. But there is a lot of overhead to spawning that process pool (chiefly because of heavy, intertwined imports in the opentrons package that we have not yet been able to untangle). The optimization is that if we know we won't have any work to feed that process pool, we can avoid creating it in the first place.

The most common practical scenario where this applies is first-time server startup. That happens dozens of times in our integration tests, so this helps developer experience.

Performance testing

On my laptop, this saves ~30 seconds when running make -C robot-server test. In CI, it saves about a minute.

Correctness testing

We're well-covered by existing integration tests.

Review requests

Does the comment make sense?

Risk assessment

Low.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner December 23, 2024 20:36
Copy link
Contributor

@TamarZanzouri TamarZanzouri left a comment

Choose a reason for hiding this comment

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

Nice!

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