Here are some typical results from benchmarking your routine along with some of the routines in the other thread. (I omitted ikegami's as he wasn't happy with it):
c:\test>708290-b -LOG=4 -MAX=1e3 Testing buk with 10 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.000244 seconds Testing funky with 10 random values in the range 0 .. 1e3 Differen +ce:= 65; took 0.000118 seconds Testing tilly with 10 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.004491 seconds Testing tye with 10 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.001024 seconds Testing buk with 100 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.005047 seconds Testing funky with 100 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.000587 seconds Testing tilly with 100 random values in the range 0 .. 1e3 Differen +ce:= 1; took 15.174596 seconds Testing tye with 100 random values in the range 0 .. 1e3 + ******* timed out after 60 seconds Testing buk with 1000 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.015625 seconds Testing funky with 1000 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.007535 seconds Testing tilly with 1000 random values in the range 0 .. 1e3 + ******* timed out after 60 seconds Testing tye with 1000 random values in the range 0 .. 1e3 + ******* timed out after 60 seconds Testing buk with 10000 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.075423 seconds Testing funky with 10000 random values in the range 0 .. 1e3 Differen +ce:= 1; took 0.190954 seconds Testing tilly with 10000 random values in the range 0 .. 1e3 + ******* timed out after 60 seconds Testing tye with 10000 random values in the range 0 .. 1e3 + ******* timed out after 60 seconds c:\test>708290-b -LOG=4 -MAX=1e4 Testing buk with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.000326 seconds Testing funky with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.000102 seconds Testing tilly with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.003578 seconds Testing tye with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.001063 seconds Testing buk with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.044324 seconds Testing funky with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 7; took 0.000601 seconds Testing tilly with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 15.901730 seconds Testing tye with 100 random valuesin the range 0 .. 1e4 + ******* timed out after 60 seconds Testing buk with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.515625 seconds Testing funky with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.008393 seconds Testing tilly with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.013012 seconds Testing tye with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 92467; took 0.016869 seconds Testing buk with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 4.654061 seconds Testing funky with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.136925 seconds Testing tilly with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.148673 seconds Testing tye with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 2252553; took 1.632284 seconds c:\test>708290-b -LOG=4 -MAX=1e4 Testing buk with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 2; took 0.003548 seconds Testing funky with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 198; took 0.000107 seconds Testing tilly with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 2; took 0.003799 seconds Testing tye with 10 random valuesin the range 0 .. 1e4 Differenc +e:= 2; took 0.001117 seconds Testing buk with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.213406 seconds Testing funky with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 2; took 0.000587 seconds Testing tilly with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 0; took 0.003341 seconds Testing tye with 100 random valuesin the range 0 .. 1e4 Differenc +e:= 1282; took 0.001121 seconds Testing buk with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.007796 seconds Testing funky with 1000 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.007606 seconds Testing tilly with 1000 random valuesin the range 0 .. 1e4 + ******* timed out after 60 seconds Testing tye with 1000 random valuesin the range 0 .. 1e4 + ******* timed out after 60 seconds Testing buk with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 4.281250 seconds Testing funky with 10000 random valuesin the range 0 .. 1e4 Differenc +e:= 1; took 0.150492 seconds Testing tilly with 10000 random valuesin the range 0 .. 1e4 + ******* timed out after 60 seconds Testing tye with 10000 random valuesin the range 0 .. 1e4 + ******* timed out after 60 seconds
The full benchmark code is here:
In reply to Re: NP-complete sometimes isn't (A benchmark)
by BrowserUk
in thread NP-complete sometimes isn't
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |