# Codeflash Conventions for plotly.py

## Focus Targets

The user has explicitly requested optimization of these 6 specific targets:

1. **deepcopy in to_dict()** — `basedatatypes.py:3321`
   - Full deepcopy every call, even when nothing changed
   - Category: Quick win

2. **Double deepcopy in _set_compound_prop()** — `basedatatypes.py:5361-5366`
   - Deepcopies old AND new value just to check equality
   - Category: Quick win

3. **deepcopy in add_traces()** — `basedatatypes.py:2272`
   - Every trace deep-copied on add
   - Category: Quick win

4. **Quadratic validation in ColorValidator** — `basevalidators.py:1370-1388`
   - Validates array twice (validate + find_invalid)
   - Category: Medium difficulty

5. **Recursive _vals_equal() on numpy arrays** — `basedatatypes.py:5722`
   - O(n) element-wise comparison, no short-circuit
   - Category: Medium difficulty

6. **String path parsing (split_multichar)** — `utils.py:394`
   - Recursive list recreation for every path
   - Category: Quick win

## Scope

Focus ONLY on these 6 targets. Do not explore other areas of the codebase.

## Package Manager

Use `uv` for all package operations:
- `uv sync` for installing dependencies
- `uv add <package>` for adding new dependencies
- Never use pip directly

## Run Tag

Session: 2026-04-16-targeted
