Skip to content

Commit

Permalink
Skip expensive repr() in logging call when not needed (#16350)
Browse files Browse the repository at this point in the history
We were spending quite a lot of time in this function when running
tests, based on profiling.
  • Loading branch information
JukkaL authored Oct 28, 2023
1 parent 93d4cb0 commit 6c7faf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ def _build(
stdout=stdout,
stderr=stderr,
)
manager.trace(repr(options))
if manager.verbosity() >= 2:
manager.trace(repr(options))

reset_global_state()
try:
Expand Down

0 comments on commit 6c7faf3

Please sign in to comment.