{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/archaius/issues/369","labels_url":"https://api.github.com/repos/Netflix/archaius/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/archaius/issues/369/comments","events_url":"https://api.github.com/repos/Netflix/archaius/issues/369/events","html_url":"https://github.com/Netflix/archaius/pull/369","id":119609659,"number":369,"title":"Performance optimization for primitive Dynamic***Property classes","user":{"login":"kerumai","id":1029838,"avatar_url":"https://avatars.githubusercontent.com/u/1029838?v=3","gravatar_id":"","url":"https://api.github.com/users/kerumai","html_url":"https://github.com/kerumai","followers_url":"https://api.github.com/users/kerumai/followers","following_url":"https://api.github.com/users/kerumai/following{/other_user}","gists_url":"https://api.github.com/users/kerumai/gists{/gist_id}","starred_url":"https://api.github.com/users/kerumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerumai/subscriptions","organizations_url":"https://api.github.com/users/kerumai/orgs","repos_url":"https://api.github.com/users/kerumai/repos","events_url":"https://api.github.com/users/kerumai/events{/privacy}","received_events_url":"https://api.github.com/users/kerumai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-30T23:57:35Z","updated_at":"2015-12-02T01:28:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Netflix/archaius/pulls/369","html_url":"https://github.com/Netflix/archaius/pull/369","diff_url":"https://github.com/Netflix/archaius/pull/369.diff","patch_url":"https://github.com/Netflix/archaius/pull/369.patch"},"body":"This is an optimization to reduce the cpu hotspots I was seeing under load with usage of DynamicBooleanProperty/DynamicIntProperty getValue implementation.\r\nAs we use DynamicBooleanProperty's very frequently for feature-flagging in zuul, I was seeing this quite high up when profiling zuul under high load. It seems to be caused by overhead around autoboxing of the value objects to primitives (although I haven't verified this).\r\n\r\nI initially added a helper class in zuul for this - https://github.com/Netflix/zuul/blob/2.x/zuul-core/src/main/java/com/netflix/zuul/properties/CachedProperties.java - but would like to apply the same principle in archaius itself, and so have done this PR.\r\n\r\nThe PR basically changes the Dynamic{Primitive}Property classes to store the cached primitive value, and update it using the callback mechanism. And then change the existing get() method to return this cached value instead of boxing the property value object.\r\n\r\nI've included a basic benchmarking class that compares performance of the old and new implementations for boolean. See CachedPropertiesPerfTest."},"comment":{"url":"https://api.github.com/repos/Netflix/archaius/issues/comments/161150282","html_url":"https://github.com/Netflix/archaius/pull/369#issuecomment-161150282","issue_url":"https://api.github.com/repos/Netflix/archaius/issues/369","id":161150282,"user":{"login":"cloudbees-pull-request-builder","id":2611310,"avatar_url":"https://avatars.githubusercontent.com/u/2611310?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudbees-pull-request-builder","html_url":"https://github.com/cloudbees-pull-request-builder","followers_url":"https://api.github.com/users/cloudbees-pull-request-builder/followers","following_url":"https://api.github.com/users/cloudbees-pull-request-builder/following{/other_user}","gists_url":"https://api.github.com/users/cloudbees-pull-request-builder/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudbees-pull-request-builder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudbees-pull-request-builder/subscriptions","organizations_url":"https://api.github.com/users/cloudbees-pull-request-builder/orgs","repos_url":"https://api.github.com/users/cloudbees-pull-request-builder/repos","events_url":"https://api.github.com/users/cloudbees-pull-request-builder/events{/privacy}","received_events_url":"https://api.github.com/users/cloudbees-pull-request-builder/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T01:28:29Z","updated_at":"2015-12-02T01:28:29Z","body":"[NetflixOSS » archaius » archaius-pull-requests #162](https://netflixoss.ci.cloudbees.com/job/NetflixOSS/job/archaius/job/archaius-pull-requests/162/) FAILURE\nLooks like there's a problem with this pull request"}}