Does any has performance difference between Extension Function and Infix Functions in Kotlin/Java

113 views Asked by At

something stuck in my head, I would like to ask you here. I searched the web but couldn't find it. Is there any performance difference between Extension Functions and Infix Functions ? Thanks.

1

There are 1 answers

0
broot On

They are apples and oranges and the question about their performance doesn't really make too much sense.

Extension in most cases is effectively a static function and its performance is the same as any other static function.

Infix function simply provides an alternative syntax for calling a function. Infix function could be both a regular member function or an extension. They have the same performance as their non-infix equivalents.