Gerrit, Yes, I do compare apples to oranges, but my orange looks like a nice Macintosh apple when run in a single thread :-). What I do not expect is that lack of symmetry in a multiple thread situation and weird JVM CPU spikes.
WRT to encoding - thanks for the hint - I removed ASCII one from Java version and it did not make any difference. I also run your version with lazy-seq replaced with an explicit loop/recur and this weird effect is gone, making Clojure version performing relatively as well as in a single thread. Interesting data point. Still lazy-seq does not cause it when reading file without compression though, as it performs almost as fast as Java version in a multi threaded context. Thanks, Andy On Wed, Sep 16, 2015 at 2:14 AM, Gerrit Jansen van Vuuren < gerrit...@gmail.com> wrote: > one more thing although its unrelated to the performance differences seen: > > The Character encoding specified in the Java code is US-ASCII while the > clojure reader uses UTF-8. Byte to Character encoding can make huge > differences in text processing apps see > http://java-performance.info/charset-encoding-decoding-java-78/. > > If you know the encoding or can control what it should be use "ISO-8859-1" the > JDK is optimized for this encoding as it gives a one to one byte copy match. > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.