For a PHP project i have to access RESTful API. I was using curl to get familiar with the API. I can access the said API using both PHP’s cUrl library and invoking the curl utility using PHP’s shell_exec() function. Performance wise, which option would be better and why??
PS: I have my own server with root privilege.
My
cautious guess would benot too useful test snippets shows that the curl library is more performant.Edit: A little test shows, that the library is faster, but not by much. Also, if you fetch millions of URLs, network latency will more likely be a bigger problem.