{"action":"created","issue":{"url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/30","repository_url":"https://api.github.com/repos/traviskaufman/cycloneJS","labels_url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/30/comments","events_url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/30/events","html_url":"https://github.com/traviskaufman/cycloneJS/issues/30","id":153608753,"number":30,"title":"V8 optimizer disabled on _hasown","user":{"login":"niklaskarla","id":11914027,"avatar_url":"https://avatars.githubusercontent.com/u/11914027?v=3","gravatar_id":"","url":"https://api.github.com/users/niklaskarla","html_url":"https://github.com/niklaskarla","followers_url":"https://api.github.com/users/niklaskarla/followers","following_url":"https://api.github.com/users/niklaskarla/following{/other_user}","gists_url":"https://api.github.com/users/niklaskarla/gists{/gist_id}","starred_url":"https://api.github.com/users/niklaskarla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklaskarla/subscriptions","organizations_url":"https://api.github.com/users/niklaskarla/orgs","repos_url":"https://api.github.com/users/niklaskarla/repos","events_url":"https://api.github.com/users/niklaskarla/events{/privacy}","received_events_url":"https://api.github.com/users/niklaskarla/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/traviskaufman/cycloneJS/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/traviskaufman/cycloneJS/labels/techimprovement","name":"techimprovement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-07T18:11:10Z","updated_at":"2016-05-11T05:33:02Z","closed_at":null,"body":"I fiddled around with the performance of this library since I found it being significantly slower than a straight 'for (var prop in orig)' implementation. I found that replacing the below line in _handleCollectionClone improved the performance with a factor 5-7. \r\nfrom:\r\nvar isNonAccessor = _hasOwn(desc, 'value');\r\nto:\r\nvar isNonAccessor = Object.prototype.hasOwnProperty.call(input,prop);\r\n\r\nMy only guess of whats happening is that the optimizer fails due to the bind of _hasOwn for some reason. Any suggestions, or am I missing something in the behavior of the two lines here?\r\n\r\nMy test case is cloning a simple byte array of ~600 000 elements\r\n"},"comment":{"url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/comments/218365858","html_url":"https://github.com/traviskaufman/cycloneJS/issues/30#issuecomment-218365858","issue_url":"https://api.github.com/repos/traviskaufman/cycloneJS/issues/30","id":218365858,"user":{"login":"niklaskarla","id":11914027,"avatar_url":"https://avatars.githubusercontent.com/u/11914027?v=3","gravatar_id":"","url":"https://api.github.com/users/niklaskarla","html_url":"https://github.com/niklaskarla","followers_url":"https://api.github.com/users/niklaskarla/followers","following_url":"https://api.github.com/users/niklaskarla/following{/other_user}","gists_url":"https://api.github.com/users/niklaskarla/gists{/gist_id}","starred_url":"https://api.github.com/users/niklaskarla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklaskarla/subscriptions","organizations_url":"https://api.github.com/users/niklaskarla/orgs","repos_url":"https://api.github.com/users/niklaskarla/repos","events_url":"https://api.github.com/users/niklaskarla/events{/privacy}","received_events_url":"https://api.github.com/users/niklaskarla/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T05:33:02Z","updated_at":"2016-05-11T05:33:02Z","body":"My turn to appoligize. I just ran a trivial case of copying an array with dummy objects: \r\n\r\n    var cloned = {'a':{'b':3},'c':{d:\"asddsa\"}}\r\n    var o = [];\r\n    for (var i = 0; i < 1e6; i++){\r\n    //    o[i] = cloned;\r\n        o[i] = i;\r\n    }\r\n     \r\n    var s = new Date().getTime();\r\n    CY.clone(o);\r\n    var e = new Date().getTime();\r\n    console.log(\"time taken: \"+(e-s));"}}