"""Performance comparison: pyfitparsernative vs garmin-fit-sdk."""

import time

from .conftest import SAMPLE_FIT, garmin_sdk_parse


def test_timing_vs_reference(capsys):
    """Print a timing comparison; does not assert a speedup threshold."""
    from pyfitparsernative import parse_fit_file

    start = time.perf_counter()
    parse_fit_file(SAMPLE_FIT)
    native_time = time.perf_counter() - start

    start = time.perf_counter()
    garmin_sdk_parse(SAMPLE_FIT)
    ref_time = time.perf_counter() - start

    with capsys.disabled():
        print(f"\npyfitparsernative: {native_time:.3f}s")
        print(f"garmin-fit-sdk:    {ref_time:.3f}s")
        print(f"Speedup:           {ref_time / native_time:.1f}x")
