wondering if I can please get some advice on how to improve the
performance of this piece of code

(defn select-n-tournament
  [popu fit-fn n]
  (let [k 7]
    (take n (repeatedly #(first (sort-by fit-fn > (take k (shuffle
popu))))))
  )
)

The profiler is telling me that first is eating up alot of time.  The
code applies a fitness evaluation to a population of possible
solutions, sorts and take n of the fittest individuls (its for an
evolutionary strategy).  For example, how could I utilize map and
still mantain the best individual (not its actual fitness value).

thanks

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to