Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/text/unicode/norm: reduce init-time memory usage #26752
The golang.org/x/text/unicode/norm package allocs 21.47kB in its init function, regardless of whether the package is ever used.
This would help people who explicitly import it (or import it via golang.org/x/net/http2), as then the std-vendored copy would not need to also allocate the 20KB.
Perhaps some of those tables should be const strings, too, so the linker can put it in read-only sections. Then we can slice into it at runtime to get integers out.