{"action":"closed","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/598","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/598/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/598/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/598/events","html_url":"https://github.com/petkaantonov/bluebird/issues/598","id":71017164,"number":598,"title":"Strange performance issue when decalre a function inside the executor","user":{"login":"luin","id":635902,"avatar_url":"https://avatars.githubusercontent.com/u/635902?v=3","gravatar_id":"","url":"https://api.github.com/users/luin","html_url":"https://github.com/luin","followers_url":"https://api.github.com/users/luin/followers","following_url":"https://api.github.com/users/luin/following{/other_user}","gists_url":"https://api.github.com/users/luin/gists{/gist_id}","starred_url":"https://api.github.com/users/luin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luin/subscriptions","organizations_url":"https://api.github.com/users/luin/orgs","repos_url":"https://api.github.com/users/luin/repos","events_url":"https://api.github.com/users/luin/events{/privacy}","received_events_url":"https://api.github.com/users/luin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-26T06:14:36Z","updated_at":"2015-04-26T12:42:57Z","closed_at":"2015-04-26T12:42:57Z","body":"It seems that declaring a function inside the executor of Promise will decrease the performance significantly. Here's the code: http://jsperf.com/bluebird-declare-function. The case \"declare function inside bluebird promise\" is much slower than \"declare function outside bluebird promise\".\r\n\r\nThe trend is same when using the native Promise, but not as obvious as bluebird.\r\n\r\nI've read [Optimization-killers](https://github.com/petkaantonov/bluebird/wiki/Optimization-killers) but still can't find out the reason."}}