{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/5890","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/5890/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/5890/comments","events_url":"https://api.github.com/repos/babel/babel/issues/5890/events","html_url":"https://github.com/babel/babel/issues/5890","id":238989958,"number":5890,"title":"source-map-support in babel-register results in a 2x slowdown – add an option to disable?","user":{"login":"mhart","id":367936,"avatar_url":"https://avatars2.githubusercontent.com/u/367936?v=4","gravatar_id":"","url":"https://api.github.com/users/mhart","html_url":"https://github.com/mhart","followers_url":"https://api.github.com/users/mhart/followers","following_url":"https://api.github.com/users/mhart/following{/other_user}","gists_url":"https://api.github.com/users/mhart/gists{/gist_id}","starred_url":"https://api.github.com/users/mhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhart/subscriptions","organizations_url":"https://api.github.com/users/mhart/orgs","repos_url":"https://api.github.com/users/mhart/repos","events_url":"https://api.github.com/users/mhart/events{/privacy}","received_events_url":"https://api.github.com/users/mhart/received_events","type":"User","site_admin":false},"labels":[{"id":180608283,"url":"https://api.github.com/repos/babel/babel/labels/area:%20perf","name":"area: perf","color":"c5def5","default":false},{"id":438612746,"url":"https://api.github.com/repos/babel/babel/labels/good%20first%20issue","name":"good first issue","color":"bfdadc","default":true},{"id":441915610,"url":"https://api.github.com/repos/babel/babel/labels/help%20wanted","name":"help wanted","color":"bfdadc","default":true},{"id":438614032,"url":"https://api.github.com/repos/babel/babel/labels/Priority:%20High","name":"Priority: High","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2017-06-27T21:34:09Z","updated_at":"2017-10-31T01:18:12Z","closed_at":null,"author_association":"NONE","body":"Performance issue / Feature request\r\n\r\n### Babel Configuration\r\n\r\nUsing `babel-node` (or `require(\"babel-register\")`) with no extra configuration\r\n\r\n### Expected Behavior\r\n\r\nAside from the overhead during `require` calls, no significant runtime degradation should occur when using `babel-node` vs babel-compiled JS run with `node`\r\n\r\n### Current Behavior\r\n\r\nWe're seeing a ~2x slowdown using `babel-node` vs `node` on the same JS after compilation. This is on long running (~5min) tasks where the compile/require overhead is very minimal and only happens at initialization (ie, no dynamic requires that could be causing this symptom)\r\n\r\n### Possible Solution\r\n\r\nBy commenting out the `sourceMapSupport.install` call here: https://github.com/babel/babel/blob/e4b35f680d56966d3a7d4c6a7471b34f2d9ff333/packages/babel-register/src/node.js#L15-L29 – we see performance that is on par with the ahead-of-time compiled JS run with `node`. ie, a speedup of ~2x\r\n\r\nProfiling using `--prof` shows that source-map-support calls make up a good deal of usage. IIRC it was stack trace capturing and function name lookups – something similar to that.\r\n\r\nIt would be great to have an option to disable this source map support when using `babel-register`/`babel-node` – but at the moment source map support is hardcoded.\r\n\r\n### Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n| software         | version(s)\r\n| ---------------- | -------\r\n| Babel            |  babel-register@6.24.1\r\n| node             | 8.1.2\r\n| npm              | N/A\r\n| Operating System | macOS\r\n"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/340631302","html_url":"https://github.com/babel/babel/issues/5890#issuecomment-340631302","issue_url":"https://api.github.com/repos/babel/babel/issues/5890","id":340631302,"user":{"login":"aminmarashi","id":6560964,"avatar_url":"https://avatars0.githubusercontent.com/u/6560964?v=4","gravatar_id":"","url":"https://api.github.com/users/aminmarashi","html_url":"https://github.com/aminmarashi","followers_url":"https://api.github.com/users/aminmarashi/followers","following_url":"https://api.github.com/users/aminmarashi/following{/other_user}","gists_url":"https://api.github.com/users/aminmarashi/gists{/gist_id}","starred_url":"https://api.github.com/users/aminmarashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aminmarashi/subscriptions","organizations_url":"https://api.github.com/users/aminmarashi/orgs","repos_url":"https://api.github.com/users/aminmarashi/repos","events_url":"https://api.github.com/users/aminmarashi/events{/privacy}","received_events_url":"https://api.github.com/users/aminmarashi/received_events","type":"User","site_admin":false},"created_at":"2017-10-31T01:18:12Z","updated_at":"2017-10-31T01:18:12Z","author_association":"NONE","body":"I'd love to work on this, I'll look into the implementation of lazy-installing `source-map-support`."}}
{"actor":{"display_login":"aminmarashi"}}