{"action":"opened","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/1387","repository_url":"https://api.github.com/repos/Netflix/Hystrix","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1387/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1387/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1387/events","html_url":"https://github.com/Netflix/Hystrix/issues/1387","id":183652798,"number":1387,"title":"Performance problema in EnvUtils.isCompileWeaving()","user":{"login":"ricardoletgo","id":22148155,"avatar_url":"https://avatars.githubusercontent.com/u/22148155?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardoletgo","html_url":"https://github.com/ricardoletgo","followers_url":"https://api.github.com/users/ricardoletgo/followers","following_url":"https://api.github.com/users/ricardoletgo/following{/other_user}","gists_url":"https://api.github.com/users/ricardoletgo/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardoletgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardoletgo/subscriptions","organizations_url":"https://api.github.com/users/ricardoletgo/orgs","repos_url":"https://api.github.com/users/ricardoletgo/repos","events_url":"https://api.github.com/users/ricardoletgo/events{/privacy}","received_events_url":"https://api.github.com/users/ricardoletgo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T10:52:54Z","updated_at":"2016-10-18T10:52:54Z","closed_at":null,"body":"I have done some performance test and maybe I found a little problem in EnvUtils.isCompileWeaving(). \r\n\r\n`\r\n\r\n\r\n    public static WeavingMode getWeavingMode() {\r\n        String wavingModeParam = System.getProperty(\"weavingMode\", WeavingMode.RUNTIME.name()).toUpperCase();\r\n        try {\r\n            return WeavingMode.valueOf(wavingModeParam);\r\n        } catch (IllegalArgumentException e) {\r\n            throw new IllegalArgumentException(\"wrong 'weavingMode' property, supported: \" + Arrays.toString(WeavingMode.values()) + \", actual = \" + wavingModeParam, e);\r\n        }\r\n    }\r\n\r\n    public static boolean isCompileWeaving() {\r\n        return WeavingMode.COMPILE == getWeavingMode();\r\n    }\r\n\r\n`\r\nEch time seemed \"@HystrixCommand\" is invoked, EnvUtils.isCompileWeaving () reads a System.property and my profile program show that is a bottleneck.\r\n\r\nMaybe a better option is to read this property only one time, inside a static initializer block for example.\r\n\r\n`\r\n\r\n\r\n    private static String wavingModeParam;\t \r\nstatic {\r\n\t\t wavingModeParam = System.getProperty(\"weavingMode\", WeavingMode.RUNTIME.name()).toUpperCase();\r\n\t }\r\n`\r\n\r\nNext a screenshot from my profiler tool, showing the problem.\r\n\r\n![captura de pantalla de 2016-10-18 12-37-10](https://cloud.githubusercontent.com/assets/22148155/19474394/ac959b84-952f-11e6-8a88-0c081edb221f.png)\r\n"}}
{"actor":{"display_login":"ricardoletgo"}}