{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/54380784","id":54380784,"diff_hunk":"@@ -80,7 +85,7 @@\n  * Also the option affects size of ECMA Object Model's data types.\n  * In any case size of any of the types should not exceed CONFIG_MEM_POOL_CHUNK_SIZE.\n  */\n-#define CONFIG_ECMA_REFERENCE_COUNTER_WIDTH (10)\n+#define CONFIG_ECMA_REFERENCE_COUNTER_WIDTH (9)","path":"jerry-core/config.h","position":39,"original_position":39,"commit_id":"d1b7eadd30e5df2cdfa72eef0b125e0ed6ef6756","original_commit_id":"d1b7eadd30e5df2cdfa72eef0b125e0ed6ef6756","user":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"body":"I wouldn't decrease this, since even 1024 is not too big. Could we keep the original somehow?","created_at":"2016-02-29T08:36:54Z","updated_at":"2016-02-29T08:36:54Z","html_url":"https://github.com/Samsung/jerryscript/pull/874#discussion_r54380784","pull_request_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/874","_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/54380784"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/874#discussion_r54380784"},"pull_request":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/874"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/874","id":59042701,"html_url":"https://github.com/Samsung/jerryscript/pull/874","diff_url":"https://github.com/Samsung/jerryscript/pull/874.diff","patch_url":"https://github.com/Samsung/jerryscript/pull/874.patch","issue_url":"https://api.github.com/repos/Samsung/jerryscript/issues/874","number":874,"state":"open","locked":false,"title":"New Allocator and improved String handling.","user":{"login":"dbatyai","id":12066566,"avatar_url":"https://avatars.githubusercontent.com/u/12066566?v=3","gravatar_id":"","url":"https://api.github.com/users/dbatyai","html_url":"https://github.com/dbatyai","followers_url":"https://api.github.com/users/dbatyai/followers","following_url":"https://api.github.com/users/dbatyai/following{/other_user}","gists_url":"https://api.github.com/users/dbatyai/gists{/gist_id}","starred_url":"https://api.github.com/users/dbatyai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbatyai/subscriptions","organizations_url":"https://api.github.com/users/dbatyai/orgs","repos_url":"https://api.github.com/users/dbatyai/repos","events_url":"https://api.github.com/users/dbatyai/events{/privacy}","received_events_url":"https://api.github.com/users/dbatyai/received_events","type":"User","site_admin":false},"body":"This PR is the continuation of the work in #678. It was suggested there to use the recordset implementation to reduce wasted memory. I investigated this approach, but the results were rather dissapointing, as execution became almost two times slower on each test.\r\nSo, in order to reduce wasted memory while also gaining the performance benefit of using heap buffers, I experimented with a new allocator that can allocate blocks that are a multiple of 8 bytes.\r\nHere are the results:\r\n\r\n                      Benchmark |      RSS<br>(+ is better) |               Perf<br>(+ is better)\r\n                     3d-cube.js |   84k ->   88k :  -4.762% |   2.643s ->   2.657s :  -0.505%  (+-2.810%)\r\n         access-binary-trees.js |   80k ->   80k :  +0.000% |   1.410s ->   1.373s :  +2.601%  (+-2.346%)\r\n             access-fannkuch.js |   36k ->   36k :  +0.000% |   7.973s ->   7.793s :  +2.257%  (+-1.150%)\r\n                access-nbody.js |   40k ->   40k :  +0.000% |   3.080s ->   3.067s :  +0.433%  (+-2.842%)\r\n    bitops-3bit-bits-in-byte.js |   32k ->   28k : +12.500% |   1.727s ->   1.687s :  +2.317%  (+-2.678%)\r\n         bitops-bits-in-byte.js |   32k ->   28k : +12.500% |   2.657s ->   2.457s :  +7.528%  (+-2.618%)\r\n          bitops-bitwise-and.js |   28k ->   24k : +14.286% |   3.680s ->   3.467s :  +5.797%  (+-2.695%)\r\n          bitops-nsieve-bits.js |  152k ->  152k :  +0.000% |  30.107s ->  29.920s :  +0.620%  (+-2.970%)\r\n       controlflow-recursive.js |  176k ->  176k :  +0.000% |   0.890s ->   0.897s :  -0.749%  (+-3.717%)\r\n                  crypto-aes.js |  120k ->  108k : +10.000% |   4.707s ->   3.680s : +21.813%  (+-1.099%)\r\n                  crypto-md5.js |  180k ->  168k :  +6.667% |  21.473s ->   8.527s : +60.292%  (+-0.166%)\r\n                 crypto-sha1.js |  124k ->  124k :  +0.000% |   9.733s ->   4.497s : +53.801%  (+-1.646%)\r\n           date-format-tofte.js |   60k ->   64k :  -6.667% |   2.240s ->   2.273s :  -1.488%  (+-1.477%)\r\n           date-format-xparb.js |   60k ->   56k :  +6.667% |   1.083s ->   0.893s : +17.538%  (+-3.958%)\r\n                 math-cordic.js |   32k ->   36k : -12.500% |   3.000s ->   2.913s :  +2.889%  (+-1.103%)\r\n           math-partial-sums.js |   32k ->   28k : +12.500% |   1.660s ->   1.643s :  +1.004%  (+-1.993%)\r\n          math-spectral-norm.js |   36k ->   36k :  +0.000% |   1.520s ->   1.460s :  +3.947%  (+-0.166%)\r\n               string-base64.js |  164k ->  156k :  +4.878% | 149.297s ->  31.220s : +79.089%  (+-0.718%)\r\n                string-fasta.js |   44k ->   36k : +18.182% |   4.547s ->   3.570s : +21.481%  (+-3.595%)\r\n                Geometric mean: |     RSS reduction: 4.224% |               Speed up: 19.896%  (+-0.632%)\r\n\r\nMemory usage increased slightly in most cases by a few hundred bytes, because of the removal of recordset, and the rework of the literal storage, but the total memory available also increased by around the same amount, because we no longer have to store bitmaps for memory regions, so this basically evens out.\r\nOn the other hand, strings that were previously stored in char_collections now use around 15% less memory in buffers, while also providing significant performance improvement.\r\nIt's worth noting, that we also require less intermediate buffers for manipulating strings.\r\nWhen using --mem-stats, peak memory usage may seem to increase  by a larger amount, than stated before, this is the result of garbage collection triggering differently with the new allocation scheme and the increased heap size.\r\n\r\nIt's also worth noting that the new allocator could also support separated heap regions, which I plan to investigate further, since it could be very useful in some cases. Also, the maximum memory size is now less constrained, although we are still limited to 512kB because of compressed pointers.","created_at":"2016-02-11T15:04:31Z","updated_at":"2016-02-29T08:36:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fcf50ad898af1fcdf889e87c69969fd83700a68","assignee":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Samsung/jerryscript/milestones/4","html_url":"https://github.com/Samsung/jerryscript/milestones/Engine%20optimization%20&%20enhancement","labels_url":"https://api.github.com/repos/Samsung/jerryscript/milestones/4/labels","id":1188990,"number":4,"title":"Engine optimization & enhancement","description":"","creator":{"login":"egavrin","id":782710,"avatar_url":"https://avatars.githubusercontent.com/u/782710?v=3","gravatar_id":"","url":"https://api.github.com/users/egavrin","html_url":"https://github.com/egavrin","followers_url":"https://api.github.com/users/egavrin/followers","following_url":"https://api.github.com/users/egavrin/following{/other_user}","gists_url":"https://api.github.com/users/egavrin/gists{/gist_id}","starred_url":"https://api.github.com/users/egavrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egavrin/subscriptions","organizations_url":"https://api.github.com/users/egavrin/orgs","repos_url":"https://api.github.com/users/egavrin/repos","events_url":"https://api.github.com/users/egavrin/events{/privacy}","received_events_url":"https://api.github.com/users/egavrin/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":117,"state":"open","created_at":"2015-07-01T13:22:04Z","updated_at":"2016-02-25T12:59:19Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/874/commits","review_comments_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/874/comments","review_comment_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/issues/874/comments","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/d1b7eadd30e5df2cdfa72eef0b125e0ed6ef6756","head":{"label":"dbatyai:new_allocator","ref":"new_allocator","sha":"d1b7eadd30e5df2cdfa72eef0b125e0ed6ef6756","user":{"login":"dbatyai","id":12066566,"avatar_url":"https://avatars.githubusercontent.com/u/12066566?v=3","gravatar_id":"","url":"https://api.github.com/users/dbatyai","html_url":"https://github.com/dbatyai","followers_url":"https://api.github.com/users/dbatyai/followers","following_url":"https://api.github.com/users/dbatyai/following{/other_user}","gists_url":"https://api.github.com/users/dbatyai/gists{/gist_id}","starred_url":"https://api.github.com/users/dbatyai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbatyai/subscriptions","organizations_url":"https://api.github.com/users/dbatyai/orgs","repos_url":"https://api.github.com/users/dbatyai/repos","events_url":"https://api.github.com/users/dbatyai/events{/privacy}","received_events_url":"https://api.github.com/users/dbatyai/received_events","type":"User","site_admin":false},"repo":{"id":38420571,"name":"jerryscript","full_name":"dbatyai/jerryscript","owner":{"login":"dbatyai","id":12066566,"avatar_url":"https://avatars.githubusercontent.com/u/12066566?v=3","gravatar_id":"","url":"https://api.github.com/users/dbatyai","html_url":"https://github.com/dbatyai","followers_url":"https://api.github.com/users/dbatyai/followers","following_url":"https://api.github.com/users/dbatyai/following{/other_user}","gists_url":"https://api.github.com/users/dbatyai/gists{/gist_id}","starred_url":"https://api.github.com/users/dbatyai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbatyai/subscriptions","organizations_url":"https://api.github.com/users/dbatyai/orgs","repos_url":"https://api.github.com/users/dbatyai/repos","events_url":"https://api.github.com/users/dbatyai/events{/privacy}","received_events_url":"https://api.github.com/users/dbatyai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dbatyai/jerryscript","description":"","fork":true,"url":"https://api.github.com/repos/dbatyai/jerryscript","forks_url":"https://api.github.com/repos/dbatyai/jerryscript/forks","keys_url":"https://api.github.com/repos/dbatyai/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dbatyai/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dbatyai/jerryscript/teams","hooks_url":"https://api.github.com/repos/dbatyai/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/dbatyai/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/dbatyai/jerryscript/events","assignees_url":"https://api.github.com/repos/dbatyai/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/dbatyai/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/dbatyai/jerryscript/tags","blobs_url":"https://api.github.com/repos/dbatyai/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dbatyai/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dbatyai/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/dbatyai/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dbatyai/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/dbatyai/jerryscript/languages","stargazers_url":"https://api.github.com/repos/dbatyai/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/dbatyai/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/dbatyai/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/dbatyai/jerryscript/subscription","commits_url":"https://api.github.com/repos/dbatyai/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/dbatyai/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/dbatyai/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/dbatyai/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/dbatyai/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/dbatyai/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dbatyai/jerryscript/merges","archive_url":"https://api.github.com/repos/dbatyai/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dbatyai/jerryscript/downloads","issues_url":"https://api.github.com/repos/dbatyai/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/dbatyai/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/dbatyai/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/dbatyai/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dbatyai/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/dbatyai/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/dbatyai/jerryscript/deployments","created_at":"2015-07-02T08:27:55Z","updated_at":"2016-02-23T14:54:42Z","pushed_at":"2016-02-25T16:55:40Z","git_url":"git://github.com/dbatyai/jerryscript.git","ssh_url":"git@github.com:dbatyai/jerryscript.git","clone_url":"https://github.com/dbatyai/jerryscript.git","svn_url":"https://github.com/dbatyai/jerryscript","homepage":null,"size":6673,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"af715d4ad6874757077ae1670c4cff735533ce5d","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":33339660,"name":"jerryscript","full_name":"Samsung/jerryscript","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":false,"url":"https://api.github.com/repos/Samsung/jerryscript","forks_url":"https://api.github.com/repos/Samsung/jerryscript/forks","keys_url":"https://api.github.com/repos/Samsung/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/jerryscript/teams","hooks_url":"https://api.github.com/repos/Samsung/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/Samsung/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/jerryscript/events","assignees_url":"https://api.github.com/repos/Samsung/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/jerryscript/tags","blobs_url":"https://api.github.com/repos/Samsung/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/jerryscript/languages","stargazers_url":"https://api.github.com/repos/Samsung/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/Samsung/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/Samsung/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/Samsung/jerryscript/subscription","commits_url":"https://api.github.com/repos/Samsung/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/jerryscript/merges","archive_url":"https://api.github.com/repos/Samsung/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/jerryscript/downloads","issues_url":"https://api.github.com/repos/Samsung/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/jerryscript/deployments","created_at":"2015-04-03T01:10:31Z","updated_at":"2016-02-29T07:46:55Z","pushed_at":"2016-02-28T17:31:24Z","git_url":"git://github.com/Samsung/jerryscript.git","ssh_url":"git@github.com:Samsung/jerryscript.git","clone_url":"https://github.com/Samsung/jerryscript.git","svn_url":"https://github.com/Samsung/jerryscript","homepage":"","size":10505,"stargazers_count":1125,"watchers_count":1125,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":118,"mirror_url":null,"open_issues_count":61,"forks":118,"open_issues":61,"watchers":1125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/874"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/874"},"issue":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/874"},"comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/874/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/874/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/874/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/jerryscript/statuses/d1b7eadd30e5df2cdfa72eef0b125e0ed6ef6756"}}}}