{"action":"created","issue":{"url":"https://api.github.com/repos/ustwo/clockwise/issues/33","repository_url":"https://api.github.com/repos/ustwo/clockwise","labels_url":"https://api.github.com/repos/ustwo/clockwise/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/ustwo/clockwise/issues/33/comments","events_url":"https://api.github.com/repos/ustwo/clockwise/issues/33/events","html_url":"https://github.com/ustwo/clockwise/issues/33","id":197674589,"number":33,"title":"WatchFace#onTimeChanged performs expensive string formatting and concatenation irrespective of logging level","user":{"login":"trejkaz","id":43236,"avatar_url":"https://avatars.githubusercontent.com/u/43236?v=3","gravatar_id":"","url":"https://api.github.com/users/trejkaz","html_url":"https://github.com/trejkaz","followers_url":"https://api.github.com/users/trejkaz/followers","following_url":"https://api.github.com/users/trejkaz/following{/other_user}","gists_url":"https://api.github.com/users/trejkaz/gists{/gist_id}","starred_url":"https://api.github.com/users/trejkaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trejkaz/subscriptions","organizations_url":"https://api.github.com/users/trejkaz/orgs","repos_url":"https://api.github.com/users/trejkaz/repos","events_url":"https://api.github.com/users/trejkaz/events{/privacy}","received_events_url":"https://api.github.com/users/trejkaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-27T09:32:11Z","updated_at":"2017-01-01T02:45:10Z","closed_at":null,"body":"`WatchFace#onTimeChanged` is currently implemented as follows:\r\n\r\n        protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) {\r\n            Logr.v(String.format(\"WatchFace.onTimeChanged: oldTime=%d; newTime=%d\",\r\n                    oldTime.millis, newTime.millis));\r\n        }\r\n\r\nThis performs string formatting which involves allocation of new `char[]` and `String` objects on every render cycle, irrespective of whether this event is being logged. The symptom is stuttering when rendering in interactive mode. By modifying my overridden method such that it no longer calls `super.onTimeChanged`, my rendering has become much smoother.\r\n\r\nIt should probably at least check whether the event will be logged before doing the concatenation. I see similar things going on in `onWatchModeChanged` and others, but those don't seem to be called anywhere near as often.\r\n"},"comment":{"url":"https://api.github.com/repos/ustwo/clockwise/issues/comments/269890273","html_url":"https://github.com/ustwo/clockwise/issues/33#issuecomment-269890273","issue_url":"https://api.github.com/repos/ustwo/clockwise/issues/33","id":269890273,"user":{"login":"trejkaz","id":43236,"avatar_url":"https://avatars.githubusercontent.com/u/43236?v=3","gravatar_id":"","url":"https://api.github.com/users/trejkaz","html_url":"https://github.com/trejkaz","followers_url":"https://api.github.com/users/trejkaz/followers","following_url":"https://api.github.com/users/trejkaz/following{/other_user}","gists_url":"https://api.github.com/users/trejkaz/gists{/gist_id}","starred_url":"https://api.github.com/users/trejkaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trejkaz/subscriptions","organizations_url":"https://api.github.com/users/trejkaz/orgs","repos_url":"https://api.github.com/users/trejkaz/repos","events_url":"https://api.github.com/users/trejkaz/events{/privacy}","received_events_url":"https://api.github.com/users/trejkaz/received_events","type":"User","site_admin":false},"created_at":"2017-01-01T02:45:10Z","updated_at":"2017-01-01T02:45:10Z","body":"Oh yeah, I notice there is also this thing.\r\n\r\n      public static final boolean DEBUG = Boolean.parseBoolean(\"true\");\r\n\r\nBut it's always set to `true` for me. So it could be that the real bug here is that the artifact clockwise is publishing to the repo is built with this stuff enabled, when really it was supposed to be disabled.\r\n\r\n"}}
{"actor":{"display_login":"trejkaz"}}