prefect icon indicating copy to clipboard operation
prefect copied to clipboard

High Memory Usage

Open aaazzam opened this issue 1 year ago • 2 comments

Bug summary

Using uv and memray we can run

uvx --with prefect memray run --force --output flow.bin --force -c "from prefect import flow" \
&& uvx memray flamegraph --force flow.bin \
&& open memray-flamegraph-flow.html 

and look at the corresponding flamegraph. You'll notice importing flow allocates ~1GB+ in memory to simply import flow, of which ~50MB stems from Prefect "primitives" whereas a whopping 1GB comes from Pendulum.

Version info

Version:             3.1.9
API version:         0.8.4
Python version:      3.10.14
Git commit:          e1fe7943
Built:               Fri, Dec 20, 2024 4:33 PM
OS/Arch:             darwin/arm64
Profile:             local
Server type:         server
Pydantic version:    2.10.4

Additional context

No response

aaazzam avatar Dec 21 '24 02:12 aaazzam

Pendulum is also holding us back from 3.13 support at the moment (ref issue: https://github.com/pydantic/pydantic-extra-types/issues/239).

cicdw avatar Dec 21 '24 18:12 cicdw

Would be curious to see how this looks in Python 3.13 specifically

cicdw avatar May 13 '25 01:05 cicdw