diff --git a/CHANGELOG.md b/CHANGELOG.md index b23d71a7..b9887e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/ ## [Unreleased](https://github.com/hynek/structlog/compare/26.1.0...HEAD) +### Changed + +- Logging is now slightly faster: `structlog.BoundLoggerBase._process_event` -- which runs on every log call -- no longer unpacks the event keyword arguments into a fresh keyword dict just to merge them into the event dict. + Passing the mapping positionally to `dict.update` is behavior-preserving and avoids that per-call overhead. + [#821](https://github.com/hynek/structlog/pull/821) + ## [26.1.0](https://github.com/hynek/structlog/compare/25.5.0...26.1.0) - 2026-06-06 diff --git a/src/structlog/_base.py b/src/structlog/_base.py index 93845e65..79db8551 100644 --- a/src/structlog/_base.py +++ b/src/structlog/_base.py @@ -166,7 +166,7 @@ def _process_event( # We're typing it as Any, because processors can return more than an # EventDict. event_dict: Any = self._context.copy() - event_dict.update(**event_kw) + event_dict.update(event_kw) if event is not None: event_dict["event"] = event