{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/14624","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14624/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14624/comments","events_url":"https://api.github.com/repos/golang/go/issues/14624/events","html_url":"https://github.com/golang/go/issues/14624","id":138282922,"number":14624,"title":"cmd/link: traverse the symbol table less","user":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-03T20:03:05Z","updated_at":"2016-03-03T20:03:05Z","closed_at":null,"body":"@ianlancetaylor commented in CL 20165:\r\n\r\n> The single slowest operation a linker can do is traverse the symbol table and look at every symbol.  The single biggest improvement in link time in the gold linker was changing the number of symbol table traversals from about 25 to about 3.  Yet cmd/link traverses the entire symbol table all the time.  It's not good.\r\n\r\n@crawshaw replied:\r\n\r\n> Agreed. There are a couple of other not good features:\r\n>\r\n>  * LSym has a Type word, but it's not filled out until some nebulous intermediate pass, so lots of code (like this) ends up string matching on the symbol name prefix.\r\n>  * dodata does some odd build-a-linked-list, then sort-the-linked-list-into-segments game.\r\n>\r\n> I think these problems and the many traversals could be fixed by the object file reader assigning Type and building useful link-wide slices when a symbol is read in. But it is pretty major surgery I'm not ready to perform.\r\n\r\nI've moved this to an issue, since folks look for work and ideas in issues.\r\n\r\ncc @mwhudson who likes object files. :)\r\n"}}