C# strikes the balance between speed and dynamic features IMHO. Especially for games that need mod support (which is not that uncommon at all), using C# allows for the modders to easily interface with existing code, while still getting near-native performance thanks to the type system and JIT. C++ code in such case would be too rigid to be modified and hard to interface wth.
You can access C#'s GC metrics through `System.GC.GetTotalAllocatedBytes` and similar APIs. Maybe you can make a benchmark and tracker for it yourself!
Maybe changing it into finding an archive file given its ID (not an auto-incrementing key, but something like its owner's national identification number) is better? They both belong to the category of creating a sorted dictionary structure in the physical world.