reflect: StructOf with very large arrays is slow #52741
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
What did you expect to see?
I expected creating the type to be fast, though I can see why that is a naive assumption.
What did you see instead?
Running the test takes 6s, most of the time is spent in
addTypeBits
followed by(*bitVector).append
:For very large arrays it takes a long time to extend the bitvector one byte at a time, with lots of copying going on etc.
The text was updated successfully, but these errors were encountered: