{"action":"opened","issue":{"url":"https://api.github.com/repos/babel/babel/issues/8420","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/8420/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/8420/comments","events_url":"https://api.github.com/repos/babel/babel/issues/8420/events","html_url":"https://github.com/babel/babel/issues/8420","id":347513197,"node_id":"MDU6SXNzdWUzNDc1MTMxOTc=","number":8420,"title":"Consider using `Array#slice()` for spread?","user":{"login":"bmeurer","id":815988,"node_id":"MDQ6VXNlcjgxNTk4OA==","avatar_url":"https://avatars3.githubusercontent.com/u/815988?v=4","gravatar_id":"","url":"https://api.github.com/users/bmeurer","html_url":"https://github.com/bmeurer","followers_url":"https://api.github.com/users/bmeurer/followers","following_url":"https://api.github.com/users/bmeurer/following{/other_user}","gists_url":"https://api.github.com/users/bmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/bmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmeurer/subscriptions","organizations_url":"https://api.github.com/users/bmeurer/orgs","repos_url":"https://api.github.com/users/bmeurer/repos","events_url":"https://api.github.com/users/bmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/bmeurer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-03T19:36:33Z","updated_at":"2018-08-03T19:36:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Recently `Array#slice()` got a significant performance boost in V8, and is currently the fastest way to clone arrays in V8 (we're working on getting `[...a]` to parity). Maybe it's worth evaluating to use that for spread instead of `Array#concat()`? At least in the case where you're essentially cloning an array?\r\n\r\nFor example\r\n\r\n```js\r\nconst b = [...a];\r\n```\r\n\r\ncould transpile to\r\n\r\n```js\r\nfunction _cloneArray(a) {\r\n  return Array.isArray(a) ? a.slice() : [].concat(a);\r\n}\r\n\r\nvar b = _cloneArray(a);\r\n```\r\n\r\nin loose mode, and to\r\n\r\n```js\r\nfunction _cloneArray(a) {\r\n  return Array.isArray(a) ? a.slice() : _toConsumableArray(a);\r\n}\r\n\r\nvar b = _cloneArray(a);\r\n```\r\n\r\nin general.\r\n\r\nDoes that make sense?"}}
{"actor":{"display_login":"bmeurer"}}