Created
October 25, 2017 14:59
-
-
Save obriencj/9a6ca7689fc8ced3c431eccadb2a19f2 to your computer and use it in GitHub Desktop.
timing different fibonacci functions in the sibilant compiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://github.com/obriencj/python-sibilant/blob/cd25328ebe7d255fc05df00579c07d2ea74937be/examples/sample-project/sibsampl/cli.lspy