Skip to content

Instantly share code, notes, and snippets.

View justinttl's full-sized avatar

Justin Lee justinttl

View GitHub Profile
@justinttl
justinttl / marshal_benchmark.py
Last active February 8, 2024 01:18
FastAPI marshaling performance analysis
import json
from time import time
from typing import List, Type
import matplotlib.pyplot as plt
import orjson
import pandas as pd
from fastapi.encoders import jsonable_encoder
from fastapi.utils import create_response_field
from pydantic import BaseModel