Search Issue Tracker
Won't Fix
Won't Fix in 2023.2.X
Votes
0
Found in
2021.3.22f1
2022.2.11f1
2023.1.0b6
2023.2.0a7
Issue ID
UUM-32155
Regression
No
MemoryExtensions.IndexOf allocates gigabytes of memory when using StringComparison overload
Reproduction steps:
1. Open the attached project “IndexProject“
2. Enter The Play Mode
3. Observe the Console
Expected result: MemoryExtensions.IndexOf works directly with ReadOnlySpan<> without creating a large number of new allocations
Actual result: IndexOfSlow() is exponentially slower than IndexOfFast()
Reproducible with: 2021.3.22f1, 2022.2.11f1, 2023.1.0b6, 2023.2.0a7
Couldn’t test with: 2020.3.46f1- ”error CS0246: The type or namespace name 'ReadOnlySpan<>' could not be found”
Reproducible on: Windows 10
Note: “IndexOfSlow()” in “Assets/ProblemBehaviour.cs“ uses MemoryExtensions.IndexOf with StringComparison overload creates a large number of allocations which causes a long garbage collection time.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
Resolution Note:
We're not planning to correct this issue on the Mono base class library implementation that Unity uses now.
Resolution Note (2023.2.X):
We're not planning to correct this issue on the Mono base class library implementation that Unity uses now.