Skip to content

Recursive function slowdown #564

@ScriptBasic

Description

@ScriptBasic

I have noticed that V7 performance takes a dive when doing recursive function calls. Try this Fibonacci example to see what I mean. Fibonacci(32) should allow you to have lunch before completion. :-(

function fibonacci(n) {
  if (n <= 2) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}   

print(fibonacci(24));

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions