C# List - Tuning Up InsertRange() - Part 2 @JamieKingCS
C# List - Tuning Up InsertRange() - Part 2  @JamieKingCS
Uploaded January 2014 | Updated September 2026, 2 weeks ago
Inserting into a C# List using InsertRange() may require the C# List to enlarge itself (thus copying elements from the old underlying array to a new underlying array) and then copy again to shuffle items down the array to make room for the new items. In our C# List InsertRange() method, we dodge the extra copy by placing the copied items where they should be in the first place. We trade memory and some time overhead for a huge speed gain.
C# List - Tuning Up InsertRange() - Part 2Entity Framework Relationships Fluent APIOpenGL glGetAttribLocation glBindAttribLocation ExamplesComputer Science ReligionScaling Surface NormalsC# foreach CastRC Car DisassemblyPololu Micro Serial Servo Controller with a Mac USBInvariantsglVertexAttribPointer vs glVertexAttribTesting CodeEntity Framework Foreign Key Code First
Jamie King |

C# List - Tuning Up InsertRange() - Part 2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER