{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/3977","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3977/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3977/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3977/events","html_url":"https://github.com/elixir-lang/elixir/pull/3977","id":118215594,"number":3977,"title":"Fix #3914: split IEx server/evaluator state to prevent unnecessary copying","user":{"login":"antipax","id":56482,"avatar_url":"https://avatars.githubusercontent.com/u/56482?v=3","gravatar_id":"","url":"https://api.github.com/users/antipax","html_url":"https://github.com/antipax","followers_url":"https://api.github.com/users/antipax/followers","following_url":"https://api.github.com/users/antipax/following{/other_user}","gists_url":"https://api.github.com/users/antipax/gists{/gist_id}","starred_url":"https://api.github.com/users/antipax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antipax/subscriptions","organizations_url":"https://api.github.com/users/antipax/orgs","repos_url":"https://api.github.com/users/antipax/repos","events_url":"https://api.github.com/users/antipax/events{/privacy}","received_events_url":"https://api.github.com/users/antipax/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-21T19:18:12Z","updated_at":"2015-11-21T19:35:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3977","html_url":"https://github.com/elixir-lang/elixir/pull/3977","diff_url":"https://github.com/elixir-lang/elixir/pull/3977.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/3977.patch"},"body":"* Splits `IEx.State` into `IEx.State` (which contains `cache`, `counter`, and `prefix`)  and `IEx.Evaluator.State` (which contains `binding`, `scope`, and `env`).\r\n* `IEx.State` continues to be stored in the server and passed to the evaluator\r\n* `IEx.Evaluator.State` is stored in the evaluator to enhance performance when large values are stored\r\n* Peeking at the environment is retrieved via message-passing from the evaluator, rather than simply returned from the server.\r\n\r\nIn my testing I noticed that `IEx.Server.current_env/0` didn't work with the new code, but it also seemed not to work without this patch, as well. Not sure what the intended use of that function is. Other than that, everything seems to work as expected and all iex tests pass."},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/158676653","html_url":"https://github.com/elixir-lang/elixir/pull/3977#issuecomment-158676653","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3977","id":158676653,"user":{"login":"antipax","id":56482,"avatar_url":"https://avatars.githubusercontent.com/u/56482?v=3","gravatar_id":"","url":"https://api.github.com/users/antipax","html_url":"https://github.com/antipax","followers_url":"https://api.github.com/users/antipax/followers","following_url":"https://api.github.com/users/antipax/following{/other_user}","gists_url":"https://api.github.com/users/antipax/gists{/gist_id}","starred_url":"https://api.github.com/users/antipax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antipax/subscriptions","organizations_url":"https://api.github.com/users/antipax/orgs","repos_url":"https://api.github.com/users/antipax/repos","events_url":"https://api.github.com/users/antipax/events{/privacy}","received_events_url":"https://api.github.com/users/antipax/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T19:35:40Z","updated_at":"2015-11-21T19:35:40Z","body":"I'll also add that with this PR, the example in #3914 no longer exhibits the undesirable behavior when evaluating `1` after generating large data."}}