Commit 333acf7
authored
Lazy load validation package on import of datadog_checks.checks (DataDog#23936)
* Load the security module only when a check needs it
Importing datadog_checks.checks always pulls in the security module
(datadog_checks.base.utils.models.validation.security), which accounts for about
1 MiB of memory, even for checks that never use it. Now it's lazy loaded, so the
security module is only loaded on use. That saves about 1 MiB for checks that
don't need it, with no change for the ones that do.
* Add changelog entry for PR1 parent b60d7eb commit 333acf7
4 files changed
Lines changed: 15 additions & 10 deletions
File tree
- datadog_checks_base
- changelog.d
- datadog_checks/base
- checks
- utils/models/validation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 31 | + | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
| |||
431 | 427 | | |
432 | 428 | | |
433 | 429 | | |
434 | | - | |
| 430 | + | |
435 | 431 | | |
436 | 432 | | |
437 | 433 | | |
438 | 434 | | |
439 | 435 | | |
440 | 436 | | |
441 | 437 | | |
442 | | - | |
| 438 | + | |
443 | 439 | | |
444 | 440 | | |
445 | 441 | | |
446 | 442 | | |
447 | 443 | | |
448 | 444 | | |
449 | | - | |
| 445 | + | |
450 | 446 | | |
451 | 447 | | |
452 | 448 | | |
| |||
689 | 685 | | |
690 | 686 | | |
691 | 687 | | |
692 | | - | |
| 688 | + | |
693 | 689 | | |
694 | 690 | | |
695 | 691 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments