On my home computer, using the same options, the java version runs in 1.5 milliseconds, and David's 1.2 Clojure version in 16 milliseconds. I'm at a loss as to why you're still seeing such a large gap between the two versions.
On Jan 28, 6:16 pm, Robert McIntyre <[email protected]> wrote: > I'm running my JVM with: > > -verbose:gc -Xmn500M -Xms2000M -Xmx2000M -server > > sincerely, > --Robert McIntyre > > > > > > > > On Fri, Jan 28, 2011 at 4:24 PM, Benny Tsai <[email protected]> wrote: > > Hi Robert, > > > Just out of curiosity, are you running Clojure with the -server > > option? When I run David's code, -server mode cuts the time for the > > first run by half, and the time for subsequent runs by a factor of 5. > > > On Jan 28, 12:36 pm, Robert McIntyre <[email protected]> wrote: > >> David, thanks for your suggestions. > > >> I copied your code and tested it out, but on my machine it takes 230 > >> milliseconds while the java version takes about 3. > > >> If it's not too much trouble, how long does the java implementation > >> take on your machine? > > >> sincerely, > >> --Robert McIntyre > > >> On Fri, Jan 28, 2011 at 2:11 PM, David Nolen <[email protected]> > >> wrote: > >> > On Fri, Jan 28, 2011 at 2:01 PM, Aaron Cohen <[email protected]> wrote: > > >> >> On Fri, Jan 28, 2011 at 1:55 PM, David Nolen <[email protected]> > >> >> wrote: > >> >> > As a comparison, the following accomplishes the same thing in 1.3.0. > >> >> > (ns test) > >> >> > (set! *unchecked-math* true) > >> >> > (set! *warn-on-reflection* true) > >> >> > (def buffer-size 1920000) > >> >> > (def array (byte-array buffer-size)) > >> >> > (defn java-like [^bytes cpuArray] > >> >> > (loop [i (int 0)] > > >> >> Is this hint still necessary on 1.3.0? > > >> > The int cast on 0 was an oversight on my part. It's not necessary. > >> > David > > >> > -- > >> > 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 > > > -- > > 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 -- 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
