hyperRail icon indicating copy to clipboard operation
hyperRail copied to clipboard

Use curl everywhere for speed improvements

Open nicoverbruggen opened this issue 10 years ago • 10 comments

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.

nicoverbruggen avatar Jun 06 '14 16:06 nicoverbruggen

Why not use https://github.com/guzzle/guzzle? More high level library

pietercolpaert avatar Jul 18 '14 11:07 pietercolpaert

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

bramdevries avatar Aug 16 '14 20:08 bramdevries

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 :)

pietercolpaert avatar Aug 16 '14 23:08 pietercolpaert

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.

bramdevries avatar Aug 17 '14 06:08 bramdevries

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!

pietercolpaert avatar Aug 17 '14 09:08 pietercolpaert

Any update on this?

Tjoosten avatar Aug 12 '15 17:08 Tjoosten

Nope... You can tackle this one if you want!

pietercolpaert avatar Aug 23 '15 08:08 pietercolpaert

i will try. But can you assist me?

Tjoosten avatar Aug 23 '15 10:08 Tjoosten

Guzzle now used

pietercolpaert avatar Aug 30 '15 16:08 pietercolpaert

@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.

Tjoosten avatar Aug 30 '15 18:08 Tjoosten