hyperRail
hyperRail copied to clipboard
Use curl everywhere for speed improvements
file_get_contents
is used to fetch some data. If we replace it with curl, we can get some serious speed improvements.
http://mdb9.wordpress.com/2011/03/06/file_get_contents-vs-curl-what-has-better-performance/
Up to 30% (!) speed improvements.
Why not use https://github.com/guzzle/guzzle? More high level library
Why not switch to using my wrapper around the iRail api? It uses Guzzle and supports all of the API endpoints. https://github.com/bramdevries/irail-php
Because the intention is to make this the main scraper and API. We will deprecate the other API at data.irail.be and api.irail.be. This can thus not have another API as a requirement :)
But currently the api.irail.be is still used throughout the application so I don't see any harm to switch it now and once you have the API set up in this repository we can switch it again.
I'd rather do the switch immediately than first changing it to to something intermediate. I'll work on it before the end of August!
Any update on this?
Nope... You can tackle this one if you want!
i will try. But can you assist me?
Guzzle now used
@pietercolpaert I see that Guzzle is used. But there a still file_get_content
& curl
attributes in the code. Maybe we can reopen it. And close it again when all the attributes are converted.