I have two php applications that communicate with each other with a REST api, by using curl. Both applications are hosted on the same server.

My question is: Does it not give overhead to use curl for communication on the same server? Is it perhaps better to create a custom php function for this purpose?