On Wed, Jan 27, 2016 at 2:28 AM, Ryan Gonzalez <rym...@gmail.com> wrote: >>rosuav@sikorsky:~$ gcc fib.c && time ./a.out >>1134903170 >> >>real 0m9.104s >>user 0m9.064s >>sys 0m0.000s >>rosuav@sikorsky:~$ cat fib.c >>#include <stdio.h> >> >>unsigned long fib(unsigned long n) >>{ >> if (n < 2) return n; >> return fib(n-2) + fib(n-1); >>} >> >>int main() >>{ >> printf("%lu\n",fib(45)); >>} >> > > *cough* -O3 *cough* >
Oh, I'm sorry. Let's try it again. rosuav@sikorsky:~$ gcc -O3 fib.c && time ./a.out 1134903170 real 0m3.153s user 0m3.088s sys 0m0.052s Cool! Seems to be linear. From which we can deduce that Python on my system was compiled at about -O275. ChrisA _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com