Skip to content

Optimize InstanceOffer construction#3794

Merged
r4victor merged 3 commits intomasterfrom
issue_3479_catalog_item_to_offer
Apr 20, 2026
Merged

Optimize InstanceOffer construction#3794
r4victor merged 3 commits intomasterfrom
issue_3479_catalog_item_to_offer

Conversation

@r4victor
Copy link
Copy Markdown
Collaborator

@r4victor r4victor commented Apr 20, 2026

Part of #3479

  • Replace expensive InstanceOffer.dict() and InstanceOfferWithAvailability() construction with InstanceOffer.dict and InstanceOfferWithAvailability.construct() that skips validation.
  • Optimize catalog_item_to_offer by using .construct()
  • Drop Resources._description deprecated root validator calculation.

Local testing:

  • runpod — 0.66s => 0.03s (22x)
  • amddevcloud — 2.26s => 0.85s (2.7x)
  • cudo — 2.48s => 1.02s (2.4x)
  • digitalocean — 1.71s => 1.31s (1.3x)
  • verda — 3.27s => 1.74s (1.9x)
  • lambda — 3.24s => 1.89s (1.7x)
  • hotaisle — 2.50s => 1.76s (1.4x)
  • vastai — 3.27s => 1.77s (1.8x)
  • vultr — 3.24s => 2.30s (1.4x)
  • gcp — 3.74s => 2.54s (1.5x)
  • nebius — 3.27s => 2.45s (1.3x)
  • crusoe — 3.98s => 2.82s (1.4x)
  • azure — 5.83s => 3.11s (1.9x)
  • aws — 6.58s => 3.56s (1.8x)

Notes:

  • Huge improvements on backends with small/no networking component.
  • On smaller cloud machines the improvements should be even more substantial.

@r4victor r4victor merged commit 1ad9e5b into master Apr 20, 2026
28 checks passed
@r4victor r4victor deleted the issue_3479_catalog_item_to_offer branch April 20, 2026 11:21
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