Skip to content

Instantly share code, notes, and snippets.

@obriencj obriencj/output
Created Oct 25, 2017

Embed
What would you like to do?
timing different fibonacci functions in the sibilant compiler
certainly:sample-project siege$ sibsampl timeit --fib 2000 --number 1000
calculating fibonacci of 2000
answer is 4224696333392304878706725602341482782579852840250681098010280137314308584370130707224123599639141511088446087538909603607640194711643596029271983312598737326253555802606991585915229492453904998722256795316982874482472992263901833716778060607011615497886719879858311468870876264597369086722884023654422295243347964480139515349562972087652656069529806499841977448720155612802665404554171717881930324025204312082516817125
fibonacci memoized -> maximum recursion depth exceeded
fibonacci via loop over 1000 loops -> 0.9649
fibonacci with TCO over 1000 loops -> 3.3678
fibonacci with TCR over 1000 loops -> 0.6501
certainly:sample-project siege$ sibsampl timeit --fib 300 --number 1000
calculating fibonacci of 300
answer is 222232244629420445529739893461909967206666939096499764990979600
fibonacci memoized over 1000 loops -> 0.1608
fibonacci via loop over 1000 loops -> 0.1410
fibonacci with TCO over 1000 loops -> 0.4961
fibonacci with TCR over 1000 loops -> 0.0932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.