Quantcast
Viewing all articles
Browse latest Browse all 493

Comment by Federico klez Culloca on Is there some sort of pool in Java that avoids repeating recents arithmetic operations?

@DeborahAnn that's something that you have to decide. You should measure both solution and decide whether the memory/computation tradoff is worth it. By the way the words you should be looking for are "caching" and "memoization" which represent two different approaches to this kind of problem. But generally, if the computation is not expensive (for example if those methods are not called in a tight loop) you may just leave it as is and let the jvm optimize it if it needs to.

Viewing all articles
Browse latest Browse all 493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>