prefect
prefect copied to clipboard
High Memory Usage
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
Pendulum is also holding us back from 3.13 support at the moment (ref issue: https://github.com/pydantic/pydantic-extra-types/issues/239).
Would be curious to see how this looks in Python 3.13 specifically