Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
runtime/map: Memory pre-allocation high for maps with large number of keys #40163
What version of Go are you using (
This is expected. Maps grow by a factor of 2 under the covers, to amortize the cost of growing.
(BTW, you should notice this behavior with or without presizing.)
I'm going to close this issue, as I don't think there's much we can do without a fundamental redesign of maps.