Performance: identify hot paths that can use C extension bindings #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Audit the codebase for Python hot paths that have available C-accelerated alternatives. Candidates: JSON serialisation (orjson instead of stdlib json — drop-in for FastAPI with response_class=ORJSONResponse); datetime parsing (ciso8601 or pendulum); S3 streaming (aiobotocore already uses C extensions, verify); SQLAlchemy query compilation (psycopg3 C extension vs asyncpg); JWT decode (use PyJWT with cryptography C backend, already in deps). Profile first with py-spy or cProfile on a representative workload to confirm actual hot paths before switching. Low-risk wins: orjson is ~10x faster than stdlib json and requires minimal code change.