Welcome santhosh
Quoting from the Programming Perl book
There is overhead calling subroutines ,Especially when u pass lengthy parameter list or return lengthy values
try passing values by reference, passing values as dynamically scoped globals, inlining the subroutine, or rewriting the whole loop in C