# attrs import time optimization

## Status: PR open upstream

## What was done

- Identified `inspect` (~12ms) as the primary import time bottleneck in attrs
- Deferred `import inspect` from module level to first use in `_compat.py` and `_make.py`
- Lazy-loaded `converters` and `validators` submodules from `attr/__init__.py` and `attrs/__init__.py`
- Benchmarked on Azure VM (Standard_D2s_v5): **25-28% improvement** (42ms -> 31ms)
- Opened PR on fork: https://github.com/KRRT7/attrs/pull/1
- Opened upstream PR: https://github.com/python-attrs/attrs/pull/1547

## Branches

- `perf/defer-inspect-import` on `KRRT7/attrs` — single clean commit `4fbde9c`

## VM

- Resource group: `attrs-BENCH-RG`
- VM: `attrs-bench` (Standard_D2s_v5, westus2)
- State: **deallocated**
- Last IP: 20.109.155.88

## Next

- Monitor upstream PR for maintainer feedback
- Respond to any review comments
- VM can be destroyed once PR is merged or closed: `bash infra/vm-manage.sh destroy`
