Thanks to cl-format:

(fn
 [buf__2572__auto__ len__2573__auto__]
 (if (= len__2573__auto__ 1)
     (mask8 (. buf__2572__auto__ (get)))
     (let [arr__2574__auto__ (int-array len__2573__auto__)]
       (dotimes
   [i__2575__auto__ len__2573__auto__]
 (aset-int
          arr__2574__auto__
          i__2575__auto__
          (mask8 (. buf__2572__auto__ (get)))))
       arr__2574__auto__)))

This is the expansion for (make-reader get mask8), where were you attempting
putting the int coercion to to the mask-fn?

David

On Tue, Mar 31, 2009 at 11:38 AM, Vincent Foley <vfo...@gmail.com> wrote:

>
> I tried using aset-int and I tried using int to coerce the result of
> mask-fn, the input argument to mask-fn and few other things, but none
> of that seems to make a difference so far.  Mind you, this is an
> aspect of Clojure that I find a little confusing, so I'm just putting
> int calls here and there and looking at what happens.
>
> On Mar 31, 10:46 am, Christophe Grand <christo...@cgrand.net> wrote:
> > Did you try to coerce the result of (~mask-fn ...) with int?
> > (or use aset-int as suggested by David)
> >
> > On Tue, Mar 31, 2009 at 4:17 PM, Vincent Foley <vfo...@gmail.com> wrote:
> >
> > > No, but in my defense I did not know such a function existed :)  I'll
> > > give it a whirl and report back!
> >
> > > On Mar 31, 9:57 am, David Nolen <dnolen.li...@gmail.com> wrote:
> > > > Did you try using aset-int instead of aset?
> >
> > > > On Tue, Mar 31, 2009 at 8:25 AM, Vincent Foley <vfo...@gmail.com>
> wrote:
> >
> > > > > For those interested, I managed to improve the performance of my
> > > > > original program from 2 minutes 40 seconds to decode 1000+ files
> down
> > > > > to 2 minutes.  I'm still far from my goal, but it's an improvement,
> > > > > especially since the code is shorter and (IMO) cleaner.  You can
> see
> > > > > it here:
> > > > >
> http://bitbucket.org/gnuvince/clj-starcraft/src/tip/src/starcraft/rep.
> > > ..
> >
> > > > > And here's another question, running the program with -Xprof shows
> > > > > that nearly 20% of my execution time is spent calling
> > > > > java.lang.reflect.Array.set.  Is there something wrong with the way
> I
> > > > > type hint my array in make-reader?
> >
> > > > > Thanks,
> >
> > > > > Vincent.
> >
> > > > > On Mar 19, 8:12 pm, Vincent Foley <vfo...@gmail.com> wrote:
> > > > > > Hello,
> >
> > > > > > For the past few days, I've been trying, unsuccessfully, to make
> an
> > > > > > application I wrote faster.  A Java program that performs, more
> or
> > > > > > less, the same task takes 12 seconds (on my machine) to parse
> 1000
> > > > > > files; my Clojure program takes nearly 3 minutes.  This more than
> an
> > > > > > order of magnitude slower!  Using the profiling tools available
> with
> > > > > > the JVM, I quickly determined which function was the costliest.
>  I
> > > > > > copied it into a simple script file to profile it in isolation.
>  I
> > > > > > have made the script and the profile results (long!) available at
> > > this
> > > > > > URL:http://gist.github.com/82136
> >
> > > > > > I'm finding the results puzzling: is dereferencing a var *that*
> > > > > > expensive?  Can anyone tell me if they see something
> fundamentally
> > > > > > wrong with my approach that would explain this abysmal
> performance?
> >
> > > > > > Thank you,
> >
> > > > > > Vincent.
> >
> > > > > > P.S.: I am using Sun's JVM 1.6.0_10 as shipped in Ubuntu Ibex.
>  My
> > > > > > machine is an Athlon 64 X2 4200+ with 3 GB of RAM.
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to