{"action":"created","issue":{"url":"https://api.github.com/repos/threadly/threadly/issues/139","labels_url":"https://api.github.com/repos/threadly/threadly/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/threadly/threadly/issues/139/comments","events_url":"https://api.github.com/repos/threadly/threadly/issues/139/events","html_url":"https://github.com/threadly/threadly/pull/139","id":72211443,"number":139,"title":"This improves the rate the profiler can collect samples","user":{"login":"jentfoo","id":2165757,"avatar_url":"https://avatars.githubusercontent.com/u/2165757?v=3","gravatar_id":"","url":"https://api.github.com/users/jentfoo","html_url":"https://github.com/jentfoo","followers_url":"https://api.github.com/users/jentfoo/followers","following_url":"https://api.github.com/users/jentfoo/following{/other_user}","gists_url":"https://api.github.com/users/jentfoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jentfoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jentfoo/subscriptions","organizations_url":"https://api.github.com/users/jentfoo/orgs","repos_url":"https://api.github.com/users/jentfoo/repos","events_url":"https://api.github.com/users/jentfoo/events{/privacy}","received_events_url":"https://api.github.com/users/jentfoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/threadly/threadly/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"lwahlmeier","id":4663016,"avatar_url":"https://avatars.githubusercontent.com/u/4663016?v=3","gravatar_id":"","url":"https://api.github.com/users/lwahlmeier","html_url":"https://github.com/lwahlmeier","followers_url":"https://api.github.com/users/lwahlmeier/followers","following_url":"https://api.github.com/users/lwahlmeier/following{/other_user}","gists_url":"https://api.github.com/users/lwahlmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/lwahlmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwahlmeier/subscriptions","organizations_url":"https://api.github.com/users/lwahlmeier/orgs","repos_url":"https://api.github.com/users/lwahlmeier/repos","events_url":"https://api.github.com/users/lwahlmeier/events{/privacy}","received_events_url":"https://api.github.com/users/lwahlmeier/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/threadly/threadly/milestones/32","html_url":"https://github.com/threadly/threadly/milestones/3.8.0%20Release","labels_url":"https://api.github.com/repos/threadly/threadly/milestones/32/labels","id":1071351,"number":32,"title":"3.8.0 Release","description":"I thought 3.7.0 was going to be the last release before 4.0.0, but we had a few more api changes.  This will absolutely be the last release before 4.0.0!\r\n\r\nChanges in this release:\r\n\r\n* Moved AbstractService out of org.threadly.concurrent and into the package org.threadly.util.  We also added a \"ServiceInteface\" in case you wanted to have an interface extend the ServiceInterface.","creator":{"login":"jentfoo","id":2165757,"avatar_url":"https://avatars.githubusercontent.com/u/2165757?v=3","gravatar_id":"","url":"https://api.github.com/users/jentfoo","html_url":"https://github.com/jentfoo","followers_url":"https://api.github.com/users/jentfoo/followers","following_url":"https://api.github.com/users/jentfoo/following{/other_user}","gists_url":"https://api.github.com/users/jentfoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jentfoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jentfoo/subscriptions","organizations_url":"https://api.github.com/users/jentfoo/orgs","repos_url":"https://api.github.com/users/jentfoo/repos","events_url":"https://api.github.com/users/jentfoo/events{/privacy}","received_events_url":"https://api.github.com/users/jentfoo/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2015-04-16T21:18:34Z","updated_at":"2015-04-30T16:24:03Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-04-30T16:23:57Z","updated_at":"2015-04-30T20:46:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/threadly/threadly/pulls/139","html_url":"https://github.com/threadly/threadly/pull/139","diff_url":"https://github.com/threadly/threadly/pull/139.diff","patch_url":"https://github.com/threadly/threadly/pull/139.patch"},"body":"It turns out that using Thread.getAllStackTraces() is more efficent than calling Thread.enumerate(Thread[]).  Even though we made good improvements in maintaining that array as thread counts don't change, that enumeration happens on the ThreadGroup, and requires synchronization between each one.  getAllStackTraces makes two native calls, one to get all the threads (which constructs the array), and two to dump the stack trace elements for all the threads.  It then constructs a map and adds in the threads to their relative stack traces.\r\nUltimately this is about 10x faster than the previous version, though does require some additional code and jar space."},"comment":{"url":"https://api.github.com/repos/threadly/threadly/issues/comments/97962452","html_url":"https://github.com/threadly/threadly/pull/139#issuecomment-97962452","issue_url":"https://api.github.com/repos/threadly/threadly/issues/139","id":97962452,"user":{"login":"lwahlmeier","id":4663016,"avatar_url":"https://avatars.githubusercontent.com/u/4663016?v=3","gravatar_id":"","url":"https://api.github.com/users/lwahlmeier","html_url":"https://github.com/lwahlmeier","followers_url":"https://api.github.com/users/lwahlmeier/followers","following_url":"https://api.github.com/users/lwahlmeier/following{/other_user}","gists_url":"https://api.github.com/users/lwahlmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/lwahlmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwahlmeier/subscriptions","organizations_url":"https://api.github.com/users/lwahlmeier/orgs","repos_url":"https://api.github.com/users/lwahlmeier/repos","events_url":"https://api.github.com/users/lwahlmeier/events{/privacy}","received_events_url":"https://api.github.com/users/lwahlmeier/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T20:46:52Z","updated_at":"2015-04-30T20:46:52Z","body":"@jentfoo Do you think it might be worth looking into making it smarter?  instead of having 2 implementations just have one class that has 2 calls and 1 smart call.  The smart call will figure out if the number of threads is great enough to call getAllStackTraces or not, and in the situations where you have to use one or the other you just call that method instead?"}}