If I understand correctly what you're saying, I don't find this to be true,
at least for this simple example.

   vv=: 3 : 0
   1 vv y
:
   x*%.y%x
)

   mm=. ([: <: [: +: 0 ?@$~ ])&.>2$&.>10+i.100  NB. 100 arguments

   (10) 6!:2 'vv&.>mm'
0.288892
   (10) 6!:2 '1 vv&.>mm'
0.295604
   (10) 6!:2 '10 vv&.>mm'
0.293436

These timings look virtually identical.


On Fri, Aug 23, 2013 at 9:11 PM, bill lam <[email protected]> wrote:

> Can you give a detail account of how you tested the performance?
>
> Пт, 23 авг 2013, Pascal Jasmin писал(а):
> >
> >
> > apologies if this issue is well known,
> >
> > If you use a bivalent verb definition such as
> >
> > v =: 3 : 0
> > (default; params) v y NB. just delegates to dyadic implementation
> > :
> > dyadic implementation
> > )
> >
> > then calling it monadically is 1000x+ slower than calling it dyadically,
> or by changing the definition to:
> >
> > v =: 3 : '(default; params) v y'
> > vD =: 4 : 0
> > dyadic implementation
> > )
> >
> >
> > Is there some other workaround for the monadic definition that doesn't
> affect performance?
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to