Originally posted by bug77
View Post
Announcement
Collapse
No announcement yet.
Falcon: A New, Faster JIT Compiler For Java/JVM
Collapse
X
-
Originally posted by smitty3268 View Post
That's not true, there are valid reasons to use reflection. You just have to know when that is and when it shouldn't be used - in other words, be a decent developer.
Legit reflection use cases are rare. Very rare.
Comment
-
Originally posted by bug77 View Post
I was hinting that if you've reached the point where you have to ask about its performance, you've probably used it too much.
Legit reflection use cases are rare. Very rare.
Comment
-
Originally posted by smitty3268 View Post
In performance sensitive code, yes. But i think there are plenty of cases where you might want to use it somewhere in an app, and it just so happens that you still want to AOT compile the app because other parts of it are performance sensitive. In fact, I'd always do that just to speed up the start time assuming it's possible, and it would be a shame if that automatically meant reflection of any type was no longer an option.
AoT seems to be working just fine for Android (ok, it's not entirely the same thing), so I'm not worried.
Comment
-
Originally posted by bug77 View PostConsidering Java 9 is only a couple of months away
Comment
-
Originally posted by bug77 View PostLegit reflection use cases are rare. Very rare.
- Likes 2
Comment
-
Originally posted by Delgarde View Post
You think so? I'd say it's one of the most heavily-used APIs in the Java world... and legitimately so. Dependency-injection frameworks depend on it. Most database persistence frameworks like JPA / Hibernate) depend on it. Proxy-based transaction management depends on it. Many of the UI frameworks like JSF or JSP depend on it. Many of the XML/JSON serialisation frameworks depend on it. You get the idea... for any kind of enterprise code, reflection is *everywhere*.
And a special giggle for mentioning JSP and JSF in 2017
Comment
-
Originally posted by bug77 View PostThat is all true. At the same time 99%+ of the Java applications aren't dependency injection frameworks or JPA or JTA implementations. If you get my drift.
And a special giggle for mentioning JSP and JSF in 2017
- Likes 1
Comment
-
Yes, reflection is inherently slow and code using it can be rewritten to be faster. It's also flexible so you can find out faster if your great idea is a good idea. Some day there will be a language that, restricted and decorated, can compile down to templated c++ with stack allocation, but is as easy to write as javascript would be if it came with python containers. I keep expecting this out of Java and other JVM languages.
Comment
Comment