1. Standard Lib ceil() is Slower by 2-3%



include bench.e

include euslibs_math.e
include math.e

sequence p
   p = {}
	
set_bench_timer(3) -- want 3-second tests

add_test("Standard Lib ceil()",routine_id("ceil"))
add_test("EusLibs ceil()",routine_id("euslibs_ceil"))

set_bench_parameter( {{3.2,-4.7,6.8,19.23,21}} )
run_tests() -- first test with 5 elements

for t=1 to 10000 do
   p &= rand(10000) / 100
end for

set_bench_parameter( {p} )
run_tests() -- second test with 10000 elements


Typical results from running a benchmark:

Final Results:

EusLibs ceil() - 2232042 <-- Fastest!
Standard Lib ceil() - 2159694 <-- Slower by 3.241337%

The EusLibs ceil() is just -floor(-a).

I guess floor() is a Speedy Gonzalez, eh? :)

new topic     » topic index » view message » categorize

2. Re: Standard Lib ceil() is Slower by 2-3%

c.k.lester wrote:
> 
> The EusLibs ceil() is just -floor(-a).
> 
> I guess floor() is a Speedy Gonzalez, eh? :)

I think you have an old version? the current version of ceil in the standard lib
is just that -floor(-a)

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Standard Lib ceil() is Slower by 2-3%

Jeremy Cowgar wrote:
> c.k.lester wrote:
> > The EusLibs ceil() is just -floor(-a).
> > I guess floor() is a Speedy Gonzalez, eh? :)
> I think you have an old version? the current version of ceil in the standard
> lib is just that -floor(-a)

I've learned my lesson. Update every morning. ;)

Your new standard lib code is conflicting with my EusLibs, so I'm making this
announcement: as Jeremy updates the standard libs, I'm going to REMOVE the
CORRESPONDING funcs/procs from EusLibs. All opposed, say NAY.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Standard Lib ceil() is Slower by 2-3%

c.k.lester wrote:
> 
> Jeremy Cowgar wrote:
> > c.k.lester wrote:
> > > The EusLibs ceil() is just -floor(-a).
> > > I guess floor() is a Speedy Gonzalez, eh? :)
> > I think you have an old version? the current version of ceil in the standard
> > lib is just that -floor(-a)
> 
> I've learned my lesson. Update every morning. ;)
> 
> Your new standard lib code is conflicting with my EusLibs, so I'm making this
> announcement: as Jeremy updates the standard libs, I'm going to REMOVE the
> CORRESPONDING funcs/procs from EusLibs. All opposed, say NAY.

I wonder if this should be done at the point that 3.2 is released? For instance,
this has not happened yet, but, say someone add's a function ceil() and then it's
decided that it should not be part of the standard library and 5 days later
removed. You would have deleted code.

I wonder how many people are keeping up with and using SVN copy is production? I
would hope no one.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu