{"action":"created","issue":{"url":"https://api.github.com/repos/google/flogger/issues/21","repository_url":"https://api.github.com/repos/google/flogger","labels_url":"https://api.github.com/repos/google/flogger/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/google/flogger/issues/21/comments","events_url":"https://api.github.com/repos/google/flogger/issues/21/events","html_url":"https://github.com/google/flogger/issues/21","id":319969652,"node_id":"MDU6SXNzdWUzMTk5Njk2NTI=","number":21,"title":"Logging at disabled level is far from free","user":{"login":"forax","id":828220,"node_id":"MDQ6VXNlcjgyODIyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/828220?v=4","gravatar_id":"","url":"https://api.github.com/users/forax","html_url":"https://github.com/forax","followers_url":"https://api.github.com/users/forax/followers","following_url":"https://api.github.com/users/forax/following{/other_user}","gists_url":"https://api.github.com/users/forax/gists{/gist_id}","starred_url":"https://api.github.com/users/forax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forax/subscriptions","organizations_url":"https://api.github.com/users/forax/orgs","repos_url":"https://api.github.com/users/forax/repos","events_url":"https://api.github.com/users/forax/events{/privacy}","received_events_url":"https://api.github.com/users/forax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-03T15:26:53Z","updated_at":"2018-09-06T18:18:23Z","closed_at":"2018-09-06T18:18:23Z","author_association":"NONE","body":"I've written a simple JMH test that test log4j, logback, java.util.logging ang flogger (with the system backend).\r\n\r\nWhen the logging is disable, Flogger is faster than log4j and logback but slower than java.util.logging.\r\nDid i have done something wrong ?\r\n"},"comment":{"url":"https://api.github.com/repos/google/flogger/issues/comments/419192656","html_url":"https://github.com/google/flogger/issues/21#issuecomment-419192656","issue_url":"https://api.github.com/repos/google/flogger/issues/21","id":419192656,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTE5MjY1Ng==","user":{"login":"hagbard","id":867170,"node_id":"MDQ6VXNlcjg2NzE3MA==","avatar_url":"https://avatars0.githubusercontent.com/u/867170?v=4","gravatar_id":"","url":"https://api.github.com/users/hagbard","html_url":"https://github.com/hagbard","followers_url":"https://api.github.com/users/hagbard/followers","following_url":"https://api.github.com/users/hagbard/following{/other_user}","gists_url":"https://api.github.com/users/hagbard/gists{/gist_id}","starred_url":"https://api.github.com/users/hagbard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagbard/subscriptions","organizations_url":"https://api.github.com/users/hagbard/orgs","repos_url":"https://api.github.com/users/hagbard/repos","events_url":"https://api.github.com/users/hagbard/events{/privacy}","received_events_url":"https://api.github.com/users/hagbard/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T18:18:23Z","updated_at":"2018-09-06T18:18:23Z","author_association":"COLLABORATOR","body":"We have worked hard for the (still internal) Android version of Flogger to make sure that tools like Proguard can identify disabled log statements and completely remove them (including loggers and variable setup). However this requires bytecode rewriting and would probably not really help much on servers with hotspot compilation anyway (and it obviously doesn't let you re-enable logging at run time either). Unfortunately this is still not quite ready to be open-sourced for frustrating technical reasons I can't really go into.\r\n\r\nAs for the server side code, the log context is deliberately bi-morphic (only 2 specific subtypes per logger; the real context and the no-op one). This is helpful because virtual method dispatch to bi-morphic types is special cased by most hotspot VMs. Thus if a log statement is seen to be \"always disabled\" then the fast-path generated by the hot-spot compiler will be very fast (it's likely to rewrite the call to hoist the logging check into the calling code). Essentially it's as fast as well can make it with our benchmarks (and we've tried all sorts of tricks).\r\n\r\nObviously if you can see any way to improve performance for disabled log statement I'd be very interested, but most of the win already comes from the API design in avoiding varags and auto-boxing (rather than super optimized code).\r\n\r\nI'll close this for now since I don't plan on changing anything at the moment, but feel free to re-open if you have ideas."}}
{"actor":{"display_login":"hagbard"}}