{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/6"}],"enrichment":{"capability":"Records and compares Django database queries and cache operations in tests, detecting performance regressions by storing fingerprinted operation logs in YAML files.","skillfed_tags":["django-testing","performance-monitoring","regression-detection"],"use_cases":["Catch unintended N+1 queries introduced by code changes before they reach production.","Document expected database and cache behavior for a test as a regression baseline.","Debug which code paths trigger specific database queries using optional traceback capture.","Exclude test-only database operations from performance records using operation filters.","Enforce consistent query patterns across a Django test suite without manual assertion counts."],"what_it_does":"django-perf-rec is a test instrumentation tool that records all database queries and cache operations executed within a test context, storing them in a YAML file for comparison on subsequent runs. When a test runs again, the new operations are compared against the stored record; if they differ, the test fails, alerting you to performance regressions. The tool fingerprints queries and cache keys by replacing variable data (like primary keys) with `#` and truncating long strings with `...`, so that incidental changes like new columns or different random data don't cause spurious test failures.\n\nIt wraps Django's lower-level `assertNumQueries` with a much richer view of what actually happened during test execution. You use it as a context manager around the code you want to profile, and it automatically determines the test name and file path for storing records. The package also provides hooks to selectively capture tracebacks for debugging specific operations and to filter which operations get recorded, useful for hiding test-only queries that would be handled differently in production.","worth_installing":"Yes, if you maintain a Django test suite and want to detect performance regressions automatically. The low install friction, permissive license, and active maintenance make it a practical choice. Note that the author recommends inline-snapshot-django as a faster alternative for new projects, so consider whether that better fits your needs; django-perf-rec remains suitable for existing codebases and will continue to receive maintenance."},"id":"django-perf-rec","links":{"html":"https://skillfed.io/packages/django-perf-rec","md":"https://skillfed.io/packages/django-perf-rec.md","pypi":"https://pypi.org/project/django-perf-rec/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-18","license_spdx":"MIT","license_treatment":"permissive","name":"django-perf-rec","python_support":"supports_current","summary":"Keep detailed records of the performance of your Django code."},"popularity":{"monthly_downloads":100108,"position":13002,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.31.0"}
