{"action":"created","issue":{"url":"https://api.github.com/repos/edvorg/req-package/issues/15","labels_url":"https://api.github.com/repos/edvorg/req-package/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/edvorg/req-package/issues/15/comments","events_url":"https://api.github.com/repos/edvorg/req-package/issues/15/events","html_url":"https://github.com/edvorg/req-package/issues/15","id":63376424,"number":15,"title":"req-package vs. eval-after-load","user":{"login":"jwiegley","id":8460,"avatar_url":"https://avatars.githubusercontent.com/u/8460?v=3","gravatar_id":"","url":"https://api.github.com/users/jwiegley","html_url":"https://github.com/jwiegley","followers_url":"https://api.github.com/users/jwiegley/followers","following_url":"https://api.github.com/users/jwiegley/following{/other_user}","gists_url":"https://api.github.com/users/jwiegley/gists{/gist_id}","starred_url":"https://api.github.com/users/jwiegley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwiegley/subscriptions","organizations_url":"https://api.github.com/users/jwiegley/orgs","repos_url":"https://api.github.com/users/jwiegley/repos","events_url":"https://api.github.com/users/jwiegley/events{/privacy}","received_events_url":"https://api.github.com/users/jwiegley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-21T08:17:50Z","updated_at":"2015-03-27T04:11:39Z","closed_at":null,"body":"Is req-package doing the same thing as implicitly wrapping every `use-package` declaration in an `eval-after-load` form that depends on each of the required packages?  I have a feeling this could be a performance-oriented way to do things, since you can start processing package immediately that have either no dependencies, or who's dependencies have already been loaded, while correctly deferred configuration of dependent packages until after their dependency has loaded.\r\n\r\nThus, if a dependency is defer-loaded, the whole use-package declaration for a dependent package could be deferred too, allowing us to skip even `:init` blocks for such packages..."},"comment":{"url":"https://api.github.com/repos/edvorg/req-package/issues/comments/86810319","html_url":"https://github.com/edvorg/req-package/issues/15#issuecomment-86810319","issue_url":"https://api.github.com/repos/edvorg/req-package/issues/15","id":86810319,"user":{"login":"edvorg","id":1499595,"avatar_url":"https://avatars.githubusercontent.com/u/1499595?v=3","gravatar_id":"","url":"https://api.github.com/users/edvorg","html_url":"https://github.com/edvorg","followers_url":"https://api.github.com/users/edvorg/followers","following_url":"https://api.github.com/users/edvorg/following{/other_user}","gists_url":"https://api.github.com/users/edvorg/gists{/gist_id}","starred_url":"https://api.github.com/users/edvorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edvorg/subscriptions","organizations_url":"https://api.github.com/users/edvorg/orgs","repos_url":"https://api.github.com/users/edvorg/repos","events_url":"https://api.github.com/users/edvorg/events{/privacy}","received_events_url":"https://api.github.com/users/edvorg/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T04:11:39Z","updated_at":"2015-03-27T04:11:39Z","body":"In some simple cases it will work. If we have\r\n```elisp\r\n(req-package foo)\r\n(req-package bar :require foo)\r\n(req-package baz :require bar)\r\n```\r\nIt's ok. We can wrap loading of `bar` in `eval-after-load` for `foo` and loading of `baz` in `eval-after-load` of `bar`.\r\n\r\nBut if I have complex graph of dependencies, it's better to use some algorithms on graphs to achieve correct loading. That's what `req-package` does. It's simple iterative algorithm based on hash map with counts of loaded dependencies. I don't see more optimal solution."}}