{"action":"created","issue":{"url":"https://api.github.com/repos/erlang/otp/issues/733","labels_url":"https://api.github.com/repos/erlang/otp/issues/733/labels{/name}","comments_url":"https://api.github.com/repos/erlang/otp/issues/733/comments","events_url":"https://api.github.com/repos/erlang/otp/issues/733/events","html_url":"https://github.com/erlang/otp/pull/733","id":76713494,"number":733,"title":"Only annotate forms when linting in the compiler","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-15T12:30:09Z","updated_at":"2015-05-26T22:45:11Z","closed_at":"2015-05-26T13:57:39Z","pull_request":{"url":"https://api.github.com/repos/erlang/otp/pulls/733","html_url":"https://github.com/erlang/otp/pull/733","diff_url":"https://github.com/erlang/otp/pull/733.diff","patch_url":"https://github.com/erlang/otp/pull/733.patch"},"body":"A lot of time spent on linting is due to eval_file_attribute/2\r\nfunction that recursively traverses all the AST, annotating\r\nthe file name on the AST nodes. This traversal happens so\r\nit is easier to add errors and warnings later on by simply\r\nintrospecting the node.\r\n\r\nThis patch changes eval_file_attribute/2 to only annotate\r\nforms (i.e. attributes and functions) and rely on the #lint\r\nrecord to keep the proper file information (which it already\r\ndid before this patch).\r\n\r\nTo summarize, both pre scan and pos scan will use the annotate\r\nfile attribute in forms, however form/2 already maintains the\r\nproper file in #lint, which we pass around when retrieving the\r\nlocation information.\r\n\r\nAfter this patch, linting of a regular erlang module with 500LOC\r\nbecame twice faster when measured with eprof."},"comment":{"url":"https://api.github.com/repos/erlang/otp/issues/comments/105690225","html_url":"https://github.com/erlang/otp/pull/733#issuecomment-105690225","issue_url":"https://api.github.com/repos/erlang/otp/issues/733","id":105690225,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T22:45:11Z","updated_at":"2015-05-26T22:45:11Z","body":"Thanks @proxyles for merging. I have found a similar regression to the called functions one but this time related to types and I have sent a fix on #747."}}