{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/5172","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/5172/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/5172/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/5172/events","html_url":"https://github.com/nodejs/node/pull/5172","id":132644513,"number":5172,"title":"lib: improve module loading performance","user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/module","name":"module","color":"fbca04"},{"url":"https://api.github.com/repos/nodejs/node/labels/performance","name":"performance","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-10T09:18:00Z","updated_at":"2016-02-19T18:12:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/5172","html_url":"https://github.com/nodejs/node/pull/5172","diff_url":"https://github.com/nodejs/node/pull/5172.diff","patch_url":"https://github.com/nodejs/node/pull/5172.patch"},"body":"This commit improves module loading performance by at least ~17-23% in the module-loader benchmarks.\r\n\r\nThis improvement is on top of the module loading performance boost brought on by #5123. Both PRs combined bring a total of ~54% improvement in module loading.\r\n\r\nSome optimization strategies include:\r\n* Try-finally/try-catch isolation\r\n* Replacing regular expressions with manual parsers\r\n* Avoiding unnecessary string and array creation\r\n* Avoiding constant recompilation of anonymous functions and\r\n   function definitions within functions"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/186339617","html_url":"https://github.com/nodejs/node/pull/5172#issuecomment-186339617","issue_url":"https://api.github.com/repos/nodejs/node/issues/5172","id":186339617,"user":{"login":"mscdex","id":54666,"avatar_url":"https://avatars.githubusercontent.com/u/54666?v=3","gravatar_id":"","url":"https://api.github.com/users/mscdex","html_url":"https://github.com/mscdex","followers_url":"https://api.github.com/users/mscdex/followers","following_url":"https://api.github.com/users/mscdex/following{/other_user}","gists_url":"https://api.github.com/users/mscdex/gists{/gist_id}","starred_url":"https://api.github.com/users/mscdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscdex/subscriptions","organizations_url":"https://api.github.com/users/mscdex/orgs","repos_url":"https://api.github.com/users/mscdex/repos","events_url":"https://api.github.com/users/mscdex/events{/privacy}","received_events_url":"https://api.github.com/users/mscdex/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T18:12:09Z","updated_at":"2016-02-19T18:12:09Z","body":"FWIW merging these changes with #3594 actually provides a much larger increase (since less time is spent doing path resolution): ~34% for the full path case and ~25% for the directory case."}}