Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
484 changes: 484 additions & 0 deletions ENHANCED_PROFILING_PLAN.md

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions LATEST_UPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Latest Update — Profiler Branch Status

**Date:** 2026-04-09
**Branch:** `profiler-updated`
**Base:** Rebased on latest `origin/main` (`9bc78ae`) — clean, no conflicts

---

## What's on This Branch

### ✅ Phase 1: Core Profiling Infrastructure (COMPLETE)
- **`performance_counter.hpp`** — Thread-safe RAII profiling with platform detection (Windows/Linux/macOS)
- **`ddbc_bindings.cpp`** — Integrated profiling submodule with Python API
- **`run_profiler.py`** — Profiler runner script
- **`profiling_results.md`** — 1,250 lines of previous profiling data

**Python API:**
```python
from mssql_python.pybind.ddbc_bindings import profiling

profiling.enable()
profiling.disable()
profiling.get_stats()
profiling.reset()
profiling.is_enabled()
```

### ✅ Phase 2: Documentation (COMPLETE)
| Document | Lines | Description |
|---|---|---|
| `PROFILER_SUMMARY.md` | 265 | Executive summary of profiling work |
| `PERF_TIMER_LOCATIONS.md` | 415 | All 43 timer locations with code snippets |
| `ENHANCED_PROFILING_PLAN.md` | 484 | New profiling points + benchmark definitions |
| `PROFILER_UPGRADE_STATUS.md` | 122 | Status tracker |

### 📋 Phase 3: Implementation (TODO)
- **43 PERF_TIMER calls** documented but not yet inserted
- Priority target: `FetchBatchData` / `construct_rows` — the critical bottleneck
- ⚠️ Line numbers in `PERF_TIMER_LOCATIONS.md` need re-mapping after rebase (main grew significantly)

---

## New Commits on Main Since Original Branch Point

13 commits merged into main since we originally branched (`95eef16`→`9bc78ae`):

| PR | Description | Impact on Profiler |
|---|---|---|
| #354 | Arrow fetch support | **High** — new fetch path needs profiling points |
| #446 | sql_variant support | Medium — new type processing to profile |
| #463 | native_uuid support | Low — new type handler |
| #477 | AI-powered issue triage | None |
| #432 | Stress test pipeline | None — CI only |
| #479 | datetime.time microseconds fix | Low |
| #483 | Credential instance cache fix | Low |
| #494 | Explicit exports from main module | None |
| #488 | Bulkcopy auth field cleanup | None |
| #466 | NULL param type mapping fix | Low |
| #475 | Bump mssql-py-core to 0.1.1 | None |
| #474 | Export Row class, refactor __init__.py | None |
| #465 | qmark detection fix | None |

### Key Takeaway
`ddbc_bindings.cpp` grew from ~4,500 to **5,895 lines** (arrow fetch + sql_variant). Profiler commit rebased cleanly — no conflicts. Phase 3 timer locations need line-number refresh, and **arrow fetch** (#354) introduces a new code path that should get its own profiling points.

---

## Commit Stats
- **Total changes:** +2,802 lines across 8 files
- **Original commit:** `2caa084` → rebased to `5e15451`
- **Reference PR:** #147 (original profiler branch)
- **Key result:** Linux slowdown reduced from **2.3x** to **16%** vs Windows

---

## Next Steps
1. Re-map 43 PERF_TIMER locations to current line numbers
2. Add profiling points for new arrow fetch path (#354)
3. Add profiling points for sql_variant processing (#446)
4. Begin Phase 3 implementation (insert PERF_TIMER calls)
5. Run benchmarks to establish new baseline post-rebase
Loading
Loading