Home / Function/ _bench_post_json() — fastapi Function Reference

_bench_post_json() — fastapi Function Reference

Architecture documentation for the _bench_post_json() function in test_general_performance.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  20ad6e00_fec4_f547_9606_3f5d2fe52dbd["_bench_post_json()"]
  f301437d_898d_b160_f85f_b6788c3d5890["test_general_performance.py"]
  20ad6e00_fec4_f547_9606_3f5d2fe52dbd -->|defined in| f301437d_898d_b160_f85f_b6788c3d5890
  f40ed4e1_b13b_3b88_a3e9_ba5ad4749ae6["test_sync_receiving_validated_pydantic_model()"]
  f40ed4e1_b13b_3b88_a3e9_ba5ad4749ae6 -->|calls| 20ad6e00_fec4_f547_9606_3f5d2fe52dbd
  5dd3fa71_8c70_341c_2671_c5bb164f59c1["test_async_receiving_validated_pydantic_model()"]
  5dd3fa71_8c70_341c_2671_c5bb164f59c1 -->|calls| 20ad6e00_fec4_f547_9606_3f5d2fe52dbd
  973b8f4e_28f7_196c_f81f_5dfe42c2aaf3["test_sync_receiving_large_payload()"]
  973b8f4e_28f7_196c_f81f_5dfe42c2aaf3 -->|calls| 20ad6e00_fec4_f547_9606_3f5d2fe52dbd
  12869fbb_b8cb_4b62_3f6d_b81926cf5d30["test_async_receiving_large_payload()"]
  12869fbb_b8cb_4b62_3f6d_b81926cf5d30 -->|calls| 20ad6e00_fec4_f547_9606_3f5d2fe52dbd
  style 20ad6e00_fec4_f547_9606_3f5d2fe52dbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/benchmarks/test_general_performance.py lines 201–211

def _bench_post_json(
    benchmark, client: TestClient, path: str, json: dict[str, Any]
) -> tuple[int, bytes]:
    warmup = client.post(path, json=json)
    assert warmup.status_code == 200

    def do_request() -> tuple[int, bytes]:
        response = client.post(path, json=json)
        return response.status_code, response.content

    return benchmark(do_request)

Domain

Subdomains

Frequently Asked Questions

What does _bench_post_json() do?
_bench_post_json() is a function in the fastapi codebase, defined in tests/benchmarks/test_general_performance.py.
Where is _bench_post_json() defined?
_bench_post_json() is defined in tests/benchmarks/test_general_performance.py at line 201.
What calls _bench_post_json()?
_bench_post_json() is called by 4 function(s): test_async_receiving_large_payload, test_async_receiving_validated_pydantic_model, test_sync_receiving_large_payload, test_sync_receiving_validated_pydantic_model.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free