Le 03/23/2016 12:20 PM, Stéphane Mottelet a écrit :
timer();for i=1:1000;sum(a($-n+10:$-n+100000));end;disp(timer())

On a 10-year old pc under linux (ubuntu 14.04):

5.5.2
n=200000;a=rand(n,1); timer();for i=1:1000;sum(a(10:100000));end;disp(timer());timer();for i=1:1000;sum(a($-n+10:$-n+100000));end;disp(timer())

    2.202731

    0.94785


6.0.0
n=200000;a=rand(n,1); timer();for i=1:1000;sum(a(10:100000));end;disp(timer());timer();for i=1:1000;sum(a($-n+10:$-n+100000));end;disp(timer())

   2.303838


   1.430211

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Antoine Monmayrant LAAS - CNRS
 7 avenue du Colonel Roche
 BP 54200
 31031 TOULOUSE Cedex 4
 FRANCE

 Tel:+33 5 61 33 64 59
email : [email protected]
 permanent email : [email protected]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
dev mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/dev

Reply via email to