Skip to content

Commit 3c1fd8f

Browse files
committed
OPTIMIZATION #5: Function pointer dispatch to eliminate switch statement
- Created typedef ColumnProcessor for function pointer type - Added ColumnProcessors namespace with specialized inline processors: * ProcessInteger, ProcessSmallInt, ProcessBigInt, ProcessTinyInt, ProcessBit * ProcessReal, ProcessDouble * ProcessChar, ProcessWChar, ProcessBinary (handle LOBs, NULL, zero-length) - Added ColumnInfoExt struct to pass metadata efficiently - Build columnProcessors array once during cache_column_metadata - Fast path: Direct function call via columnProcessors[col-1] (no switch) - Slow path: Fallback switch for complex types (DECIMAL, DATETIME, GUID) - Eliminates switch evaluation from O(rows × columns) to O(columns) - All processors use direct Python C API from OPT #1 and OPT #2
1 parent 262fb3c commit 3c1fd8f

File tree

1 file changed

+311
-243
lines changed

1 file changed

+311
-243
lines changed

0 commit comments

Comments
 (0)