I got two result sets. Weird.
If I start up JPT and paste in the J code then hit enter I get a different
result then if I run a script from a project.

NB. cut and paste
      x=: 1e6 $ ' '
    y=: a. {~ ? 1e6 $ 256
    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
1.2642
      x=: 1e6 $ ' '
    y=: a. {~ ? 1e6 $ 256
    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
1.06437
      x=: 1e6 $ ' '
    y=: a. {~ ? 1e6 $ 256
    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
1.06393
      x=: 1e6 $ ' '
    y=: a. {~ ? 1e6 $ 256
    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
1.06667

NB. open project and run script
      x=: 1e6 $ ' '
       y=: a. {~ ? 1e6 $ 256
       %/ 100 (6!:2)&> '/:~x' ; '/:~y'
2.92326
      x=: 1e6 $ ' '
    y=: a. {~ ? 1e6 $ 256
    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
2.99254


On Fri, Jul 4, 2014 at 10:59 PM, Roger Hui <[email protected]>
wrote:

> I have observed a puzzling timing result which may be CPU dependent.
>  Please try the following and tell me what ratio you get, and the kind of
> machine you ran it on.  Thanks.
>
> On my machine, an XPS L521X Intel Core i7-3632QM @ 2.2 GHz,
>
>    x=: 1e6 $ ' '
>    y=: a. {~ ? 1e6 $ 256
>    %/ 100 (6!:2)&> '/:~x' ; '/:~y'
> 2.44133
>
> Basically, sorting a constant vector of 1-byte ints takes 2.4 times as long
> as sorting a random vector of 1-byte ints.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to