diff --git a/.gitignore b/.gitignore index e19eb64..5e61a39 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ search/ uv.lock docs/_build/ config/wagtail/wagtail_settings.py +HELP-72348.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3658277..45aed4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,9 +15,3 @@ repos: - id: ruff args: [ --fix ] - id: ruff-format - -- repo: https://github.com/djlint/djLint - rev: v1.36.3 - hooks: - - id: djlint-reformat-django - - id: djlint-django diff --git a/justfile b/justfile index 6e343a2..562b722 100644 --- a/justfile +++ b/justfile @@ -107,3 +107,8 @@ alias ab := sphinx-autobuild sphinx-clean: rm -rvf docs/_build alias sc := sphinx-clean + +# ---------------------------------------- test ---------------------------------------- +[group('test')] +HELP-72348: + python test/HELP-72348.py diff --git a/test/HELP-72348/HELP-72348.py b/test/HELP-72348/HELP-72348.py new file mode 100644 index 0000000..eb9d59f --- /dev/null +++ b/test/HELP-72348/HELP-72348.py @@ -0,0 +1,20 @@ +import json +import time +from bson import encode, decode + +# Number of repetitions +x = 1 + +# Load JSON from a file +with open("HELP-72348.json") as f: + data = json.load(f) + +start = time.perf_counter() +for _ in range(x): + print(f"Running iteration {_ + 1} of {x}...") + bson_data = encode(data) + decoded_data = decode(bson_data) + +end = time.perf_counter() + +print(f"Time taken for {x} iterations: {end - start:.2f} seconds") diff --git a/test/HELP-72348/memray-flamegraph-HELP-72348.py.4949.html b/test/HELP-72348/memray-flamegraph-HELP-72348.py.4949.html new file mode 100644 index 0000000..3261ec6 --- /dev/null +++ b/test/HELP-72348/memray-flamegraph-HELP-72348.py.4949.html @@ -0,0 +1,375 @@ + + +
+ + + +