Skip to content

Instantly share code, notes, and snippets.

@cristianoliveira
Created May 8, 2018 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristianoliveira/3f72bd9fc8ac196bf3c5cffd5c669cb7 to your computer and use it in GitHub Desktop.
Save cristianoliveira/3f72bd9fc8ac196bf3c5cffd5c669cb7 to your computer and use it in GitHub Desktop.
Test Perfomance
function fibCreate() {
return function fibonacci(num) {
if (num <= 1) return 1;
return fibonacci(num - 1) + fibonacci(num - 2);
};
}
for (var i = 0, len = 40; i < len; i++) {
fibCreate()(i);
}
function fibonacci(num) {
if (num <= 1) return 1;
return fibonacci(num - 1) + fibonacci(num - 2);
}
for (var i = 0, len = 40; i < len; i++) {
fibonacci(i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment