Classify the performance complexity of the following code snippet written in Python.
def factorial(n):
   if n == 0:
       return 1
   else:
       return n * factorial(n-1)
The performance complexity of the code snippet is O(n).