On Aug 13, 7:16 pm, Nicolas Oury <nicolas.o...@gmail.com> wrote: > On Fri, Aug 13, 2010 at 2:51 PM, Mike Anderson > > <mike.r.anderson...@gmail.com> wrote: > > 2. It would be great to reduce the amount of memory allocations. Yes, > > I know memory is plentiful and GC is very cheap, but it's still not as > > cheap as stack allocation and any noticeable GC pauses are not good > > for the player experience in interactive games. For this reason, I > > find myself using reduce and indexed loops a lot more than I guess > > would normally be idiomatic, and conversely tend to avoid some of the > > lazy constructs and functions that generate sequences. While Clojure > > is great for a strategy game, I'd probably hesitate to use it for a > > real-time 3D game. > > This can be made a bit better by turning Escape Analysis on? Have you > tried that? > > The G1 collector is supposed to have lower latency. Have you tried it? > > http://research.sun.com/jtech/pubs/04-g1-paper-ismm.pdf
Sadly I feel that I'm going to have to target development at the lowest common denominator that I think users will have (hence I'm targeting Java 1.5+) Though I am excited about the prospect for the future! I think both escape analysis and G1 will help Java/Clojure massively for game development. The killer case for me is having a simple 2D or 3D point vector as a return value. It's such a common pattern in games/graphics, it can happen millions of times per second, and currently there are no nice options: it seems you either have to put up with excessive garbage, hack the return value into primitive arrays or manually "inline" the inner loop function. If escape analysis can reliably guarantee stack allocation for this kind of return value, it would be a massive win. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en