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 be not 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.
Performance is pretty much exactly the same, because the same stuff is being executed internally. But you should use the API because it is cleaner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With