Repository navigation
Commit d60e39c
committed
gh-160936: Make logging setLevel() and disable() cost O(cached loggers)
Manager._clear_cache() walked every logger in loggerDict on each setLevel() or disable() call, so configuring N loggers one at a time was quadratic. Track loggers that have populated their isEnabledFor cache in a WeakSet and clear only those.1 parent ef1fce0 commit d60e39c
2 files changed
Lines changed: 9 additions & 2 deletions
File tree
- Lib/logging
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1356 | 1356 | | |
1357 | 1357 | | |
1358 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
1359 | 1361 | | |
1360 | 1362 | | |
1361 | 1363 | | |
| |||
1471 | 1473 | | |
1472 | 1474 | | |
1473 | 1475 | | |
1474 | | - | |
1475 | | - | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
1476 | 1480 | | |
| 1481 | + | |
1477 | 1482 | | |
1478 | 1483 | | |
1479 | 1484 | | |
| |||
1799 | 1804 | | |
1800 | 1805 | | |
1801 | 1806 | | |
| 1807 | + | |
1802 | 1808 | | |
1803 | 1809 | | |
1804 | 1810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments