I recently met a programmer who argued that he doesnt like Spring because of all the proxying and the resulting lack of performance. I argued that there are most likely gazillion places in the code that should be profiled in order to make the app faster but to look at the overhead of object creation and method calls is silly in most of the cases. But he insisted on his oppinion. Of course i tried to back up my arguments with real world performance metrics on the internet but i just havent found any.
It would be really useful if the Spring guys would create a white paper when it comes to performance wrt JDK and cglib proxies. Of course there are plenty things to test. One should take a normal class, create an instance with new and make some calls to its methods. Then one could do the same with a spring bean without any services and then go ahead with spring beans with services like transactional. Of course this cant be compared to a plain pojo anymore but it would give you some numbers. Nothing hinders someone to test transactional spring beans to EJB2/3 entitiy beans or something.
But i hate speaking with people that analyzed a stacktrace of a spring bean and conclude that this is the worst of all problems, only because there are some more method calls inbetween.
Of course this person has never heard of the most trivial things in Spring like bean inheritance or the various scopes. A person who said that its better to supply each object with an applicationContext only because you dont rely on DI then and its easier to go without spring in the future. I think he just dont get the whole concept. For freaks like these it would be very handy to have numbers to throw with. Unfortunately I just dont have the time to write benchmarks for this…