{"action":"created","issue":{"url":"https://api.github.com/repos/google/protobuf/issues/1770","repository_url":"https://api.github.com/repos/google/protobuf","labels_url":"https://api.github.com/repos/google/protobuf/issues/1770/labels{/name}","comments_url":"https://api.github.com/repos/google/protobuf/issues/1770/comments","events_url":"https://api.github.com/repos/google/protobuf/issues/1770/events","html_url":"https://github.com/google/protobuf/issues/1770","id":164767831,"number":1770,"title":"Performance downgrade in multi-thread JAVA implementation","user":{"login":"fqsuncn","id":4208246,"avatar_url":"https://avatars.githubusercontent.com/u/4208246?v=3","gravatar_id":"","url":"https://api.github.com/users/fqsuncn","html_url":"https://github.com/fqsuncn","followers_url":"https://api.github.com/users/fqsuncn/followers","following_url":"https://api.github.com/users/fqsuncn/following{/other_user}","gists_url":"https://api.github.com/users/fqsuncn/gists{/gist_id}","starred_url":"https://api.github.com/users/fqsuncn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fqsuncn/subscriptions","organizations_url":"https://api.github.com/users/fqsuncn/orgs","repos_url":"https://api.github.com/users/fqsuncn/repos","events_url":"https://api.github.com/users/fqsuncn/events{/privacy}","received_events_url":"https://api.github.com/users/fqsuncn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/protobuf/labels/java","name":"java","color":"fad8c7"},{"url":"https://api.github.com/repos/google/protobuf/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-11T06:21:53Z","updated_at":"2016-07-21T17:28:04Z","closed_at":"2016-07-21T09:00:35Z","body":"I tried to test protobuf in multi-thread case, and when I launch 1 thread, the cost of processing 1,000,000\r\n records is about 40s on my machine. But when I launched 2 threads, the cost of each raised to 80s. My server is not a PC, and it has 32 cores to process.\r\n\r\n\tpublic class parseThread implements Runnable {\r\n\t\tprivate String command;\r\n\t\tprivate TestMsg testMsgInput;\r\n\t\tbyte[] buf = null;\r\n\r\n\t\tpublic parseThread(String s, TestMsg msg) {\r\n\t\t\tthis.command = s;\r\n\t\t\tthis.testMsgInput = msg;\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void run() {\r\n\r\n\t\t\t\tbuf = testMsgInput.toByteArray();\r\n\r\n\t\t\t\tfor (int k = 0; k < 1000000; k++) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTestMsg parsedMsg = TestMsg.parseFrom(buf);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n                 }"},"comment":{"url":"https://api.github.com/repos/google/protobuf/issues/comments/234324614","html_url":"https://github.com/google/protobuf/issues/1770#issuecomment-234324614","issue_url":"https://api.github.com/repos/google/protobuf/issues/1770","id":234324614,"user":{"login":"xfxyjwf","id":8551050,"avatar_url":"https://avatars.githubusercontent.com/u/8551050?v=3","gravatar_id":"","url":"https://api.github.com/users/xfxyjwf","html_url":"https://github.com/xfxyjwf","followers_url":"https://api.github.com/users/xfxyjwf/followers","following_url":"https://api.github.com/users/xfxyjwf/following{/other_user}","gists_url":"https://api.github.com/users/xfxyjwf/gists{/gist_id}","starred_url":"https://api.github.com/users/xfxyjwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xfxyjwf/subscriptions","organizations_url":"https://api.github.com/users/xfxyjwf/orgs","repos_url":"https://api.github.com/users/xfxyjwf/repos","events_url":"https://api.github.com/users/xfxyjwf/events{/privacy}","received_events_url":"https://api.github.com/users/xfxyjwf/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T17:28:04Z","updated_at":"2016-07-21T17:28:04Z","body":"@fqsuncn can you also post your benchmark results after setting optimize_for = SPEED? Were you using optimize_for = CODE_SIZE before?"}}
{"actor":{"display_login":"xfxyjwf"}}