{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript/issues/2124","repository_url":"https://api.github.com/repos/purescript/purescript","labels_url":"https://api.github.com/repos/purescript/purescript/issues/2124/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/2124/comments","events_url":"https://api.github.com/repos/purescript/purescript/issues/2124/events","html_url":"https://github.com/purescript/purescript/issues/2124","id":154839827,"number":2124,"title":"Possible compile time optimization in Sugar/Names/Env.hs?","user":{"login":"adarqui","id":1018013,"avatar_url":"https://avatars.githubusercontent.com/u/1018013?v=3","gravatar_id":"","url":"https://api.github.com/users/adarqui","html_url":"https://github.com/adarqui","followers_url":"https://api.github.com/users/adarqui/followers","following_url":"https://api.github.com/users/adarqui/following{/other_user}","gists_url":"https://api.github.com/users/adarqui/gists{/gist_id}","starred_url":"https://api.github.com/users/adarqui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adarqui/subscriptions","organizations_url":"https://api.github.com/users/adarqui/orgs","repos_url":"https://api.github.com/users/adarqui/repos","events_url":"https://api.github.com/users/adarqui/events{/privacy}","received_events_url":"https://api.github.com/users/adarqui/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/purescript/purescript/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/purescript/purescript/labels/modules","name":"modules","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/purescript/purescript/milestones/10","html_url":"https://github.com/purescript/purescript/milestones/0.9.0","labels_url":"https://api.github.com/repos/purescript/purescript/milestones/10/labels","id":858709,"number":10,"title":"0.9.0","description":"","creator":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":71,"state":"open","created_at":"2014-11-08T21:18:46Z","updated_at":"2016-05-14T19:36:45Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-05-14T07:37:55Z","updated_at":"2016-05-14T20:20:32Z","closed_at":null,"body":"Hi everyone,\r\n\r\nI have a fairly large purescript project. As the project grows, my compile times worsen. Currently, it takes a little over 3 minutes to perform a fresh build. I am using psc-0.8.5.0.\r\n\r\n```\r\n$ find output -type f | wc -l\r\n    1178\r\n$ find output -type f | xargs cat | wc -l\r\n   77524\r\n```\r\n\r\nI recently compiled psc with profiling enabled so that I could obtain a .prof dump (pulp build +RTS -p -RTS):\r\n- https://gist.github.com/adarqui/b83ecd2e94db1e3e89a07f4dcbdfe55e\r\n\r\nAs you can see from that dump, most of the time is spent in the addExport function:\r\n\r\n```\r\n==                        Language.PureScript.Names            46.6    0.0\r\naddExport                 Language.PureScript.Sugar.Names.Env  44.9    5.0\r\n```\r\n\r\nIs it possible that module could be optimized? Maybe using a Map instead of lists? I have no idea.\r\n\r\nHope that dump actually helps & makes sense.\r\n\r\nThanks!\r\n\r\n-- Andrew\r\n\r\n\r\n\r\nbtw, how I built psc using profiling:\r\n```\r\nstack build --executable-profiling --ghc-options=\"-fprof-auto -rtsopts\"\r\n```"},"comment":{"url":"https://api.github.com/repos/purescript/purescript/issues/comments/219249490","html_url":"https://github.com/purescript/purescript/issues/2124#issuecomment-219249490","issue_url":"https://api.github.com/repos/purescript/purescript/issues/2124","id":219249490,"user":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T20:20:32Z","updated_at":"2016-05-14T20:20:32Z","body":"I changed everything to `Map`, but only in `addExports`, using `M.toList` in other places to make the existing code compatible, and the performance didn't change. I expect all of the `toList`s added their own cost, so a fix for this will need a bit more work, using `Map` in other places which use the exports."}}