Readment Updates - 3 by sumitmsft · Pull Request #6 · microsoft/mssql-python

@sumitmsft

bewithgaurav added a commit that referenced this pull request

Nov 12, 2025
- Moved typedef ColumnProcessor, struct ColumnInfoExt, and all 10 inline processor functions from ddbc_bindings.cpp to ddbc_bindings.h
- Added new 'INTERNAL: Performance Optimization Helpers' section in header
- Added forward declarations for ColumnBuffers struct and FetchLobColumnData function
- Enables true cross-compilation-unit inlining for performance optimization
- Follows C++ best practices for inline function placement

Addresses review comments #4, #5, #6 from subrata-ms

bewithgaurav added a commit that referenced this pull request

Nov 12, 2025
…der file

- Moved DateTimeOffset struct definition to header (required by ColumnBuffers)
- Moved ColumnBuffers struct definition to header (required by inline functions)
- Moved typedef ColumnProcessor, struct ColumnInfoExt, and all 10 inline processor functions to header
- Added new 'INTERNAL: Performance Optimization Helpers' section in header
- Added forward declaration for FetchLobColumnData function
- Enables true cross-compilation-unit inlining for performance optimization
- Follows C++ best practices for inline function placement

Addresses review comments #4, #5, #6 from subrata-ms
Build verified successful (universal2 binary for macOS arm64 + x86_64)

bewithgaurav added a commit that referenced this pull request

Nov 12, 2025
- Moved NULL checks from inside processor functions to centralized location in main fetch loop
- All types (simple and complex) now follow same NULL-checking pattern
- Benefits:
  * Eliminates redundant branch checks (7 NULL checks per row removed)
  * Improves CPU branch prediction with single NULL check per column
  * Simplifies processor functions - they now assume non-NULL data
  * Better code consistency and maintainability

Modified files:
- ddbc_bindings.cpp: Restructured cell processing loop (lines 3257-3295)
  * Added centralized NULL/NO_TOTAL check before processor dispatch
  * NULL values now handled once per column instead of inside each processor

- ddbc_bindings.h: Updated all 10 processor functions
  * ProcessInteger, ProcessSmallInt, ProcessBigInt, ProcessTinyInt, ProcessBit
  * ProcessReal, ProcessDouble
  * ProcessChar, ProcessWChar, ProcessBinary
  * Removed redundant NULL checks from all processors
  * Added comments documenting NULL check removal (OPTIMIZATION #6)

No functional changes - NULL handling behavior unchanged, just moved to more efficient location.