The compiler used to do variable initializer sorting by looping through all the initialized variables and, for each one, looping through all the initialized variables and checking for a dependency. For very large packages with thousands of initialized global variables, this quadratic loop could take quite a long time. Change the approach to first loop through all the initialized variables and fetch all the references to other variables from the initialization code. Then, loop through them again and this time add a dependency for each referenced, initialized, variable, while checking for initialization loops. We still have a nested loop, but this time the inner loop should normally be short--just the list of referenced variables, not the list of all variables. Reviewed-on: https://go-review.googlesource.com/116816 From-SVN: r261284
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
gofrontend | Loading commit data... | |
ChangeLog | Loading commit data... | |
Make-lang.in | Loading commit data... | |
README.gcc | Loading commit data... | |
config-lang.in | Loading commit data... | |
gccgo.texi | Loading commit data... | |
go-backend.c | Loading commit data... | |
go-c.h | Loading commit data... | |
go-gcc-diagnostics.cc | Loading commit data... | |
go-gcc.cc | Loading commit data... | |
go-gcc.h | Loading commit data... | |
go-lang.c | Loading commit data... | |
go-linemap.cc | Loading commit data... | |
go-location.h | Loading commit data... | |
go-sha1.cc | Loading commit data... | |
go-system.h | Loading commit data... | |
gospec.c | Loading commit data... | |
lang-specs.h | Loading commit data... | |
lang.opt | Loading commit data... |