{"action":"created","issue":{"url":"https://api.github.com/repos/ninenines/erlang.mk/issues/493","labels_url":"https://api.github.com/repos/ninenines/erlang.mk/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/ninenines/erlang.mk/issues/493/comments","events_url":"https://api.github.com/repos/ninenines/erlang.mk/issues/493/events","html_url":"https://github.com/ninenines/erlang.mk/issues/493","id":127420053,"number":493,"title":"Optimize","user":{"login":"essen","id":141739,"avatar_url":"https://avatars.githubusercontent.com/u/141739?v=3","gravatar_id":"","url":"https://api.github.com/users/essen","html_url":"https://github.com/essen","followers_url":"https://api.github.com/users/essen/followers","following_url":"https://api.github.com/users/essen/following{/other_user}","gists_url":"https://api.github.com/users/essen/gists{/gist_id}","starred_url":"https://api.github.com/users/essen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essen/subscriptions","organizations_url":"https://api.github.com/users/essen/orgs","repos_url":"https://api.github.com/users/essen/repos","events_url":"https://api.github.com/users/essen/events{/privacy}","received_events_url":"https://api.github.com/users/essen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ninenines/erlang.mk/labels/Refactoring","name":"Refactoring","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-19T10:57:08Z","updated_at":"2016-01-19T14:02:42Z","closed_at":null,"body":"Erlang.mk has grown slow. There are a few reasons for that, one being that it really only has one optimization (one erlc call to compile all Erlang files) and has never been optimized much otherwise. Another reason is because of makedep, which while it is a very important feature to reduce compile times, also increases compile times in some cases.\r\n\r\nThe speed can be restored and even improved by looking into a number of things. My initial experiments show we can get back to the early days speed by doing just a few tiny changes.\r\n\r\nThe general ideas are as follow:\r\n\r\n* Run `make target SHELL=\"/bin/sh -x\"` and find patterns in the commands. Sometimes the same command is repeated, sometimes we can group commands.\r\n* Use := instead of = where shell commands are run to avoid repeating them.\r\n* Do a single find of all files in the src/ directory and then filter what we need in separate variables.\r\n* Experiment with lazy only-once initialization of variables where it could be benefitial.\r\n* Write a ccache-like plugin for Erlang.mk.\r\n* Provide a guile version of makedep. It should be doable because we only look at forms and have limited needs for parsing Erlang.\r\n\r\nAll points except the last two are trivial and should provide great improvements on small targets. The last two points provide great improvements to compile time. The last point is probably crazy and not necessary if we get a ccache-like up and running."},"comment":{"url":"https://api.github.com/repos/ninenines/erlang.mk/issues/comments/172862118","html_url":"https://github.com/ninenines/erlang.mk/issues/493#issuecomment-172862118","issue_url":"https://api.github.com/repos/ninenines/erlang.mk/issues/493","id":172862118,"user":{"login":"crownedgrouse","id":4357695,"avatar_url":"https://avatars.githubusercontent.com/u/4357695?v=3","gravatar_id":"","url":"https://api.github.com/users/crownedgrouse","html_url":"https://github.com/crownedgrouse","followers_url":"https://api.github.com/users/crownedgrouse/followers","following_url":"https://api.github.com/users/crownedgrouse/following{/other_user}","gists_url":"https://api.github.com/users/crownedgrouse/gists{/gist_id}","starred_url":"https://api.github.com/users/crownedgrouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crownedgrouse/subscriptions","organizations_url":"https://api.github.com/users/crownedgrouse/orgs","repos_url":"https://api.github.com/users/crownedgrouse/repos","events_url":"https://api.github.com/users/crownedgrouse/events{/privacy}","received_events_url":"https://api.github.com/users/crownedgrouse/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T14:02:42Z","updated_at":"2016-01-19T14:02:42Z","body":"I did not check in the code, but do you remove default buitins rules done by make ?\r\nhttps://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_toc.html#TOC95\r\n\r\nThis can be remove by : \r\n```\r\nMAKEFLAGS += --no-builtin-rules\r\n\r\n.SUFFIXES:\r\n.SUFFIXES: .you .own .here\r\n```\r\nand should probably increase speed on big project."}}