Re: Performance optimizations dealing with java collections

2013-06-19 Thread Tim Jones
That's it! Thanks so much for the help! In what cases is a function turned into a RestFn? variadic clojure or vararg java? I was confused about how clojure is turned into java, but things are a little clearer now. (make-array) uses java.lang.reflect.Array.newInstance, which is bad as well.

Re: Performance optimizations dealing with java collections

2013-06-18 Thread John D. Hume
Offhand it looks like the only RestFn you call from filter-link is clojure.core/format. Have you tried replacing that with something like this? (String/format (.get link 1) (doto (make-array String 1) (aset 0 (.get link 2))) I'm not suggesting that's idiomatic, but if it addresses the issue then

Re: Performance optimizations dealing with java collections

2013-06-18 Thread Tim Jones
On Tuesday, June 18, 2013 9:58:20 AM UTC-7, Michael Klishin wrote: > > 2013/6/18 Tim Jones > > >> How do I get to near-java performance? > > > Start by providing a snippet of your code and profiling. > > Great. Here's the context: iterate through a list of Product, and for each Product, get a L

Re: Performance optimizations dealing with java collections

2013-06-18 Thread Tim Jones
Let's try this again. Maybe the question is what is the most performant way to consume a native java collection (List, array, or other) in clojure? What I've tried so far hits clojure-imposed performance issues. How do I get to near-java performance? I'm trying to create a polemic for clojur

Re: Performance optimizations dealing with java collections

2013-06-18 Thread Michael Klishin
2013/6/18 Tim Jones > How do I get to near-java performance? Start by providing a snippet of your code and profiling. Most likely you are hitting either boxing or extra method calls that are not obvious from the code. But nobody can tell if that's really the case, esp. without seeing the actua

Performance optimizations dealing with java collections

2013-06-17 Thread Tim Jones
I'm working on a small clojure program which pulls data from a custom memory-backed data store via a java api. When looking at performance, there is a hotspot at the point of interaction with this API. One of the fields of each record being exported contains a list of lists of strings (List>)