#!/usr/bin/env bash
set -euo pipefail
VENV_PYTHON="$HOME/rich/.venv/bin/python"
echo "=== Per-module import time ==="
hyperfine --warmup 3 --min-runs 20 --shell=none \
  -n 'rich (top-level)' "$VENV_PYTHON -c 'import rich'" \
  -n 'rich.console.Console' "$VENV_PYTHON -c 'from rich.console import Console'" \
  -n 'rich.logging.RichHandler' "$VENV_PYTHON -c 'from rich.logging import RichHandler'" \
  -n 'rich.traceback.Traceback' "$VENV_PYTHON -c 'from rich.traceback import Traceback'" \
  -n 'rich.print_json' "$VENV_PYTHON -c 'from rich import print_json'" \
  -n 'rich.syntax.Syntax' "$VENV_PYTHON -c 'from rich.syntax import Syntax'" \
  -n 'rich.pretty' "$VENV_PYTHON -c 'import rich.pretty'" \
  -n 'rich.markdown.Markdown' "$VENV_PYTHON -c 'from rich.markdown import Markdown'"
