dotnet / machinelearning

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

Split struct should not be readonly #7009

Closed stephentoub closed 4 months ago

stephentoub commented 4 months ago

Doing so prohibits desirable optimizations, like making the TokenString property lazily initialized from the original string (otherwise, we end up allocating a new string for every split even if the string isn't used).

stephentoub commented 4 months ago

cc: @tarekgh

stephentoub commented 4 months ago

addressed in #7012