clojure-emacs / orchard

A fertile ground for Clojure tooling
Eclipse Public License 1.0
326 stars 54 forks source link

Parallelize `orchard.xref/fn-refs` #174

Closed vemv closed 1 year ago

vemv commented 1 year ago

Fixes https://github.com/clojure-emacs/orchard/issues/173

Before

(time
  (do
    (doall (xref/fn-refs #'orchard.misc/as-sym))
    1))
"Elapsed time: 3570.653465 msecs"

After

(time
  (do
    (doall (xref/fn-refs #'orchard.misc/as-sym))
    1))
"Elapsed time: 528.020007 msecs"

pmap isn't exactly the best. I had a nice Claypoole integration in a discarded PR recently. Can be a global improvement after discussion later.

Cheers - V

bbatsov commented 1 year ago

pmap isn't exactly the best.

I know this, but I strongly favor avoid dependencies in Orchard. pmap might not be perfect, but it gets the job done.

bbatsov commented 1 year ago

I know this, but I strongly favor avoid dependencies in Orchard. pmap might not be perfect, but it gets the job done.

Maybe at some point we can offer our own orchard.parallel ns with a handy pmap.

After all, Claypool does nothing that cannot be done with a basic understanding of executors.

I like this idea!