perf: replace json.dumps serialization test with isinstance fast path (#96) #109
No reviewers
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#109
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-v2-96"
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?
Closes #96
Summary
Replaces the
json.dumps(value)probe inJSONFormatter.format()with anisinstance()type-check fast path. The old code fully serialized and discarded each field's value just to test serializability — on every log call across the entire bot.Before:
After:
_SERIALIZABLE_TYPES = (str, int, float, bool, type(None))is defined at module level to avoid recreating the tuple on everyformat()call.Files changed
utils/logging.pyTest results
935 passed, 2 skipped (18 pre-existing failures from unrelated working-tree modifications)