Skip to content
Merged
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
9 changes: 9 additions & 0 deletions DuckDB.NET.Data/DataChunk/Reader/NumericVectorDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ internal override object GetValue(ulong offset, Type targetType)
_ => base.GetValue(offset, targetType)
};

// Fast path: when the boxed value already has the requested type (the common case for
// GetValue(ordinal)/this[ordinal], which read using the column's natural ClrType), skip the
// Convert.ChangeType machinery entirely. ChangeType does not early-out on same-type for
// IConvertible values — it re-boxes via ToXxx() — so this also removes a redundant box.
if (value.GetType() == targetType)
{
return value;
}

if (targetType.IsNumeric())
{
try
Expand Down
Loading