Re: finding a call to longCast

2013-10-14 Thread Andy Fingerhut
If you are proficient in reading Java bytecode, or are willing to invest some time to become so, then a disassembler like javap on the compiled .class files of your code could help. If not, then a bytecode to Java decompiler like JD-GUI or one of several others to be useful. I have used the free

Re: making a lot of small calcs parallel

2013-10-14 Thread Brian Craft
No, it's still lazy. Partitions are handed off to threads as they are needed, and the results are collected in the main thread. I found the same code in the O'Reilly book after I figured it out, in the "Parallelism on the Cheap" section. It points out the problem with pmap over small computatio

Re: making a lot of small calcs parallel

2013-10-14 Thread Sean Corfield
I nearly suggested that but it sounded so counter-intuitive and I didn't have time to construct a test-bed for it... glad you figured it out. That means that your float-seq has to be fully realized in memory tho', right? On Mon, Oct 14, 2013 at 9:58 PM, Brian Craft wrote: > Answering my own quest

Re: making a lot of small calcs parallel

2013-10-14 Thread Brian Craft
Answering my own question, my grouping example failed because of the laziness of the expressions being computed in the pmap: the threads were not evaluating the expressions until they were evaluated (sequentially) by the main thread. Adding a doall gives the result I was hoping for. On Sunday,

finding a call to longCast

2013-10-14 Thread Brian Craft
Profiling shows clojure.lang.RT.longCast is currently 25% of the run time of the code I'm working on. It's being called from a routine that manipulates primitive arrays while building a hex string, with aget, aset, inc, and bitwise operations. Looking through the source for those, I can't see w

Re: JVM assertions in Clojure

2013-10-14 Thread Paul Stadig
So it turns out it is possible to have runtime disabled assertions in Clojure without a compiler change, but I don think it is possible to have assertions that can be disabled per package without a compiler change (if at all). I have released a new library that allows you to globally enable/disabl

Re: JVM assertions in Clojure

2013-10-14 Thread Paul Stadig
On Mon, Oct 14, 2013 at 5:59 AM, Phillip Lord wrote: > writes: > > Same trick as > Java -- optimise the check away at compile time. > > Indeed, this is how Clojure's assert works. > This is the way Clojure's assert works (by compiling away the assertion). This is not the way Java assertions work

Re: making a lot of small calcs parallel

2013-10-14 Thread Brian Craft
Hm. float-seq may not fit in memory. Perhaps I can read it in blocks. On Monday, October 14, 2013 11:01:52 AM UTC-7, Herwig Hochleitner wrote: > > + make sure to pour float-seq into a vector before r/map, to make full use > of parallel folding > > > 2013/10/14 Herwig Hochleitner > > >> Try >> >>

Re: making a lot of small calcs parallel

2013-10-14 Thread Herwig Hochleitner
+ make sure to pour float-seq into a vector before r/map, to make full use of parallel folding 2013/10/14 Herwig Hochleitner > Try > > (require '[clojure.core.reducers :as r]) > (reduce (fn [res val] (get-ids val)) > nil (r/map encode float-seq)) > > This should parallel fold encode ove

Re: making a lot of small calcs parallel

2013-10-14 Thread Herwig Hochleitner
Try (require '[clojure.core.reducers :as r]) (reduce (fn [res val] (get-ids val)) nil (r/map encode float-seq)) This should parallel fold encode over float-seq (r/map) and then map get-ids in order, but without allocation. 2013/10/14 Brian Craft > I'm walking a seq of many millions of

Re: [ANN] Jig

2013-10-14 Thread Timothy Washington
This looks really cool. A few things. *A)* Looks like I have to run nrepl in the jig project directory. I'm finding that emacs also has to be started in the same jig directory. Then all of my code editing has to be referenced from that directory (ie: *C-x C-f ../my-project/my-file.clj*). If I try

Re: use lein compile a Java project

2013-10-14 Thread Gaofeng Zeng
thanks for you guide, this way is available. On Saturday, October 12, 2013 2:00:56 PM UTC+8, Shantanu Kumar wrote: > > Hi Gaofeng, > > The JAR files are dependency artifacts that must be placed in the Maven > repository. You can specify them in the :dependencies vector as below: > > : dependencie

avoiding generators

2013-10-14 Thread Brian Craft
I need to pull sequence ids from a db, which is a lot like using a generator. I found this thread about generators: https://groups.google.com/forum/?fromgroups=#!searchin/clojure/generator/clojure/IL_ONPb52-0/S_2p2-vjVCYJ which suggests using seqs, like so: (defn sines [] (cycle (map #(Math

Re: core.match on a set

2013-10-14 Thread Phillip Lord
Well, I had a very quick go at this; getting it to work simply is, actually, remarkable easy. (defmethod emit-pattern clojure.lang.IPersistentSet [pat] pat) (defmethod to-source clojure.lang.IPersistentSet [pat ocr] `(every? identity (map #(contains? ~ocr %) ~pat))) I'm guessing that this i

Re: JVM assertions in Clojure

2013-10-14 Thread Phillip Lord
writes: > Phillip, Paul - thanks a lot for you suggestions! > > Phillip - I will definitely give your trick a try. > > Right now, without experimenting, I see two shortcomings. First, as Paul > mentioned, checking assertion status via call to Java function will > introduce performance penalty,

Re: Clojure vs OSGi once again...

2013-10-14 Thread Mark Derricutt
Cheers, I took the time this morning to hack around a bit, and [forked the repository](https://github.com/talios/clojure.osgi) and updated it to: * Use, and embed/re-export clojure 1.5.1, exporting clojure related packages. * Use the `maven-bundle-plugin` From there I just adapted my internal p