Live data from Hacker News

Composer – Disable GC when computing deps and refs

github.com

91–100 of 135 posts

Re: Composer – Disable GC when computing deps and refs

#91
post #55

For those looking for a technical explanation, the PHP garbage collector in this case is probably wasting a ton of CPU cycles trying to collect thousands of objects (a LOT of objects are created to represent all the inter-package rules when solving dependencies) during the solving process. It keeps trying and trying as objects are allocated and it can not collect anything but still has to check them all every time it…

As to why the problem went unnoticed for so long, it seems that the GC is not able to be observed by profilers, so whenever we looked at profiles to improve things we obviously did not spot the issue.

That sounds like a bug in the profiler, not with Composer. Observing internal time is pretty important for any profiler.

Re: Composer – Disable GC when computing deps and refs

#92

I remember story of my friend in algorithmic contest for high school students in Poland (which are quite hard). He solved problems correctly, but in his implementation he got to check in every iteration of loop if a collection still got any elements. He used col.size()==0 instead of col.isEmpty(). The first was O(n) and it fucked up all performance.

That's a bug.

Re: Composer – Disable GC when computing deps and refs

#93
post #55

For those looking for a technical explanation, the PHP garbage collector in this case is probably wasting a ton of CPU cycles trying to collect thousands of objects (a LOT of objects are created to represent all the inter-package rules when solving dependencies) during the solving process. It keeps trying and trying as objects are allocated and it can not collect anything but still has to check them all every time it…

As to why the problem went unnoticed for so long, it seems that the GC is not able to be observed by profilers, so whenever we looked at profiles to improve things we obviously did not spot the issue. That sounds like a bug in the profiler, not with Composer. Observing internal time is pretty important for any profiler.

Yes it is definitely a failure of the tooling and I hear it is actually being worked on.

Re: Composer – Disable GC when computing deps and refs

#94

Earlier quoted context omitted.

Agreed. It's such a shame that HackerNews doesn't let you post animated GIFs - I think it'd really add a lot of value to the discussions here.

I'm hoping this is sarcasm since I don't think I've seen a single intelligent discussion in my life that was helped along by a funny GIF. Not to say there's anything wrong with funny GIF's, but I come to HN exactly because it moderates away that sort of stuff.

There is a reason why i have a extension installed in Firefox just for the ability to say when a gif is to play.

Re: Composer – Disable GC when computing deps and refs

#96
post #15

Never have I seen so many gifs on a commit page.

Then you most certainly don't remember the infamous Bumblebee Fiasco. https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commi...

Ugh. I remember that, I had posted on that to explain to the developer why there was so much attention and kept receiving mails and notifications from github for ages. At the time there was no way to "stop watching" when you had commented on something, if I remember correctly.

Re: Composer – Disable GC when computing deps and refs

#98
post #81

Earlier quoted context omitted.

This; interpreting performance numbers is hard. Also, memory nowadays is cheap, CPU power isn't.

> Also, memory nowadays is cheap, CPU power isn't. Unless you're running your deployment on a 512Mb or 1G VM. I've had composer max out swap on those too. Even with 2G RAM it's not been happy sometimes, so be interesting to see what difference this patch makes.

Yeah, i have had to move to more expensive ec2 instance on account of this very issue..

Re: Composer – Disable GC when computing deps and refs

#99
post #96

Earlier quoted context omitted.

Then you most certainly don't remember the infamous Bumblebee Fiasco. https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commi...

Ugh. I remember that, I had posted on that to explain to the developer why there was so much attention and kept receiving mails and notifications from github for ages. At the time there was no way to "stop watching" when you had commented on something, if I remember correctly.

I still have all those notification emails; I am still thinking about graphing them one day to see how the commenting rate on this thread evolved over time.
Post reply on HN