How to beat memory bloat with generators

Korvin Szanto (09.Feb.2018 at 17:15, 1 hr )
Talk at SunshinePHP 2018 (English - US)

Rating: 4 of 5

Memory usage is something that we as developers have to be aware of. Ever debugging a memory issue and find that your once small dataset has ballooned out of proportion? And instead of dealing with the issue, you opt for upping the memory limit?
Iterators can be the answer but they require a lot of code and can be very difficult to understand at a glance. Thankfully since PHP 5.5 Generators help us create and manage what would be complex iterators with simple syntax sugar.
In this talk I will go over some of the ways you can implement generators and cure your memory bloat.

Who are you?

Claim talk

Talk claims have been moved to the new Joind.in site.

Please login to the new site to claim your talk

Want to comment on this talk? Log in or create a new account or comment anonymously

Write a comment

 
Please note: you are not logged in and will be posting anonymously!
= four plus eight

Comments

Rating: 2 of 5

09.Feb.2018 at 21:18 by Dana Luther (33 comments) via Joind.in iPhone app

It was a shame that the technical issues made it so had to follow this presentation. I feel like there was a lot of good information there which I just couldn’t follow. It sounds like I definitely need to research the possibilities for implementing this type of improvement in the applications that I work with and I’m excited to learn something new. I’d kind of like to sit through it again as an un-con just to see if a smaller space and solved technical issues would help convey all the info.

Rating: 5 of 5

10.Feb.2018 at 08:57 by Jessica Dunbar (2 comments) via Web2 LIVE

Brilliant talk Korvin. Timing was perfect 30 mins and time for questions. Font was small.

Rating: 5 of 5

12.Feb.2018 at 13:36 by Trenton Bollinger (16 comments) via Web2 LIVE

I have been in this position a lot. Generally, we opt to just increase the memory limit on the script and add a comment about kicking the can down the road. Using generators seems like a great way to reduce the overhead of loading 4 copies of a multi-gigabyte data set into memory. I didn't really understand them at first, but after seeing them used in practice, I get it. :)

The slides and font could have been larger. Sitting anywhere past the first row made things difficult to read/see. Didn't affect my rating, since I think once you work out the technical issues, the material doesn't change and is still great.

© Joind.in 2018