Skip to content

Cache the default storage block #14573

Open
@abrookins

Description

@abrookins

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar request and didn't find it.
  • I searched the Prefect documentation for this feature.

Describe the current behavior

In 2.x and 3.x, we load the default storage block whenever we persist a result. This means that for every task run, we:

  • Make an API request to get the block document for the default storage block
  • Load all plugins from disk (because Block.load does this as a side effect)
  • Hydrate the block

So a flow that runs 500 tasks does this 500 times.

Describe the proposed behavior

We should cache the default block the first time we load it, at least for a short period.

Example Use

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.x3.xenhancementAn improvement of an existing featureperformanceRelated to an optimization or performance improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions