{"action":"opened","issue":{"url":"https://api.github.com/repos/passsy/CompositeAndroid/issues/13","repository_url":"https://api.github.com/repos/passsy/CompositeAndroid","labels_url":"https://api.github.com/repos/passsy/CompositeAndroid/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/passsy/CompositeAndroid/issues/13/comments","events_url":"https://api.github.com/repos/passsy/CompositeAndroid/issues/13/events","html_url":"https://github.com/passsy/CompositeAndroid/issues/13","id":154837409,"number":13,"title":"Implementation seems very heavy","user":{"login":"spierce7","id":871169,"avatar_url":"https://avatars.githubusercontent.com/u/871169?v=3","gravatar_id":"","url":"https://api.github.com/users/spierce7","html_url":"https://github.com/spierce7","followers_url":"https://api.github.com/users/spierce7/followers","following_url":"https://api.github.com/users/spierce7/following{/other_user}","gists_url":"https://api.github.com/users/spierce7/gists{/gist_id}","starred_url":"https://api.github.com/users/spierce7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spierce7/subscriptions","organizations_url":"https://api.github.com/users/spierce7/orgs","repos_url":"https://api.github.com/users/spierce7/repos","events_url":"https://api.github.com/users/spierce7/events{/privacy}","received_events_url":"https://api.github.com/users/spierce7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-14T06:21:43Z","updated_at":"2016-05-14T06:21:43Z","closed_at":null,"body":"The implementation seems very heavy when I look at the source code. I stopped being as worried about garbage collection with ART, but it seems like each stage of the Activity or Fragment lifecycle is creating at least 1, if not more objects:\r\n\r\n```Java\r\nreturn callFunction(\"getContext()\", new PluginCall<FragmentPlugin, Context>() {\r\n            @Override\r\n            public Context call(final NamedSuperCall<Context> superCall,\r\n                    final FragmentPlugin plugin, final Object... args) {\r\n\r\n                return plugin.getContext(superCall);\r\n\r\n            }\r\n        }, new SuperCall<Context>() {\r\n            @Override\r\n            public Context call(final Object... args) {\r\n                return getFragment().getContext__super();\r\n            }\r\n        });\r\n```\r\n\r\nI have no measured data on this, but couldn't this be easily implemented without the overhead of multiple function objects created at each method call?"}}