|
|
|
|
|
by gengstrand
1580 days ago
|
|
Most data focused microservices for business applications devote most of their code to calling databases. The PoC microservices that I implemented in order to evaluate Clojure use Java libraries to communicate with Cassandra, MySql, Redis, and Elastic Search. Clojure is not currently at a point in adoption where it makes a lot of sense for these database vendors to support native Clojure libraries. While it is true that not every method calls goes through Java reflection, it is also safe to say that every API call to this kind of service will end up making a lot of calls via Java reflection unless you use types hints all over the place in the DAOs. |
|
When you're doing things like I/O, an extra 0.04 milliseconds won't matter much, since the operation is already a lot slower then that. So hinting in those case generally isn't really needed, as it won't cause visible performance gains in your application.
Where hinting is worth it, is in tight loops where 0.04 ms will add up. Numeric code that uses arrays especially benefits, since the benefits of the array are lost to the reflection overhead otherwise.