Run image decoding and resizing off the event loop #75
Reference in New Issue
Block a user
Delete Branch "perf/offload-image-processing"
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?
process_image takes ~560ms on a 12MP photo (measured) and image_content_block decodes with PIL; both ran synchronously in async handlers and froze all concurrent chat streams. Now run via asyncio.to_thread in the upload handlers, the chat stream, and iMessage.
Tests: new test asserts process_image runs off the main thread. Full suite passes.
🤖 Generated with Claude Code