dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.93k stars 1.86k forks source link

Avoid boxing/unboxing in VBufferDataFrameColumn #6864

Closed asmirnov82 closed 8 months ago

asmirnov82 commented 8 months ago

VBufferDataFrameColumn stores public readonly struct Vbuffer items. This column is implemented based on current StringDataFrame column implementation, however any string is a reference type and any Vbuffer is a value type, so there are several issues with current implementation. One is boxing/unboxing that happens on ever access by row index, another - unability to store null elements (#6852)

The goal of this issue is to avoid boxing/unboxing on indexing and throw NotSupported exception with clear explanation instead of null reference exception