context_logging icon indicating copy to clipboard operation
context_logging copied to clipboard

Speed up ContextLogRecord

Open katichev opened this issue 1 year ago • 0 comments

Summary

Make ContextLogRecord faster.

Details

The context attribute for ContextLogRecord is a dict built directly from _context_data dicts instead of UserDict/ChainMap proxy. According to measurements this variant collects data ~20 times faster than previous approach.

Additional fixes:

  • faster _parent_context emptiness check
  • typo in FILL_EXCEPTIONS_DEFAULT

Also pls consider using empty dict instead of empty str for the case of empty current_context

Check list

  • [+] Tests
  • [+] README.md changed if needed

katichev avatar Oct 27 '24 15:10 katichev