← Back to Blog

Benchmark: FastAPI Framework

Testing loct on the FastAPI source (Python)

Use Case: tiangolo/fastapi - The FastAPI Framework

Repository: https://github.com/tiangolo/fastapi Stack: Python Test Date: 2025-12-08 Loctree Version: 0.6.2-dev


Overview

Testing loctree on FastAPI - the popular Python web framework with heavy decorator usage.

Repository Scale

MetricValue
Python Files1,184
Analysis Time20.69 seconds
Throughput57 files/sec

Findings

Dead Code Detection

  • High Confidence: 0
  • False Positive Rate: 0%

Route Detection

loct routes    # 451 FastAPI routes detected!

Loctree correctly identifies all FastAPI route decorators:

  • @app.get(), @app.post(), etc.
  • @router.get(), @router.post(), etc.
  • Nested routers and includes

Version History

VersionFP RateStatus
0.5.16100%BROKEN (decorators)
0.6.1-dev0%FIXED
0.6.2-dev (pre-fix)CRASHUTF-8 bug
0.6.2-dev (post-fix)0%PERFECT

Commands Used

cd FastAPI
loct                              # Create snapshot
loct dead --confidence high       # Dead code analysis
loct routes                       # Route detection (451 found!)
loct twins                        # Duplicate detection

Verdict

PERFECT - FastAPI analysis is production-ready after UTF-8 fix.

Key Insights

  1. Decorator Tracking: response_model=X correctly parsed
  2. Route Detection: 451 endpoints found automatically
  3. UTF-8 Fixed: Emoji in strings no longer crash

Special Feature: loct routes

Perfect for FastAPI projects:

loct routes              # List all endpoints
loct routes --json       # Export for documentation
loct routes --unused     # Find orphaned handlers

πš…πš’πš‹πšŽπšŒπš›πšŠπšπšπšŽπš. with AI Agents by VetCoders (c)2024-2026 LibraxisAI