Talk in English - US at SunshinePHP 2017
Track Name:
Key Biscayne 2
View Slides: http://www.slideshare.net/auroraeosrose/taming-the-resource-tiger-68241545
Short URL: https://joind.in/talk/dab4f
(QR-Code (opens in new window))
No matter how many virtual machines you throw at a problem you always have the physical limitations of hardware. Memory, CPU, and even your NIC's throughput have finite limits. Are you trying to load that 5 GB csv into memory to process it? No really, you shouldn't!
PHP has many built in features to deal with data in more efficient ways that pumping everything into an array or object. Using PHP stream and stream filtering mechanisms you can work with chunked data in an efficient matter, with sockets and processes you can farm out work efficiently and still keep track of what your application is doing. These features can help with memory, CPU, and other physical system limitations to help you scale without the giant AWS bill.
Comments
Comments are closed.
Eye-opening inside view into streams in PHP. I never knew how useful they were until now thanks Elizabeth!
More practical examples of stream usage would be great!
awesome and very funny, more examples would be fine
This was a great reminder of things that I have forgotten. Presentation flow was good. I've hit some of the same errors and growing pains, so I appreciated the humor in which Liz dealt with these. I'm always amazed at the deep core PHP knowledge that she gives away freely. Well done!
There were several meaty topics covered and Elizabeth could have gone into more detail on each one. She sure motivate me to look into streams, lazy fetch, generators and the like to manage memory usage and never assume the size of anything. She alluded to other data structures and recommended not using arrays unless they are small (and you checked they're small. Don't assume so.)
This talk was very informative to me. A good engineer is only made better when he/she understands the underpinned and inner workings of the languages and technologies they are working in. For example, I never know that every IO, not just some, in PHP are streams. I also did not know you could write and hook stream filters and such into streams with ease. I suspect, as Ms. Smith stated, that most PHP developers probably don't consider these mechanisms, largely because they don't know about them. Thank you for the very informative talk.
I liked, I've found it very helpful, thank you.
I've used streams from time to time in rare cases. Your talked opened my eyes to all the places I should be using them, but aren't. I loved the bits about the various callbacks we can attach/hook to our streams. Would of loved to see a few concrete examples of this.
Excellent info about streams! I'm a little less afraid now.
Streams. Guess I better jump in! Thanks for showing us where. Good job!