Live data from Hacker News

Composer – Disable GC when computing deps and refs

github.com

11–20 of 135 posts

Re: Composer – Disable GC when computing deps and refs

#11
The commit is great. I love that the comments have spiraled completely out of control. At this point, 30 minutes after the link was posted, the comment thread is now a competition to see who can post the best gif.

I know we're serious here, but stuff like this reminds me why I love the internet so much. It's fun to cut loose once in a while.

Re: Composer – Disable GC when computing deps and refs

#13
As far as i understand composer is roughly the same thing as the cpan client. And they just simply disabled the garbage collector for it.

What is this guy doing that he needs gigabytes of memory to install a bunch of php libraries?

    Before: Memory usage: 2194.78MB (peak: 3077.39MB), time: 1324.69s
    After:  Memory usage: 4542.54MB (peak: 4856.12MB), time:  232.66s

Re: Composer – Disable GC when computing deps and refs

#16

As far as i understand composer is roughly the same thing as the cpan client. And they just simply disabled the garbage collector for it. What is this guy doing that he needs gigabytes of memory to install a bunch of php libraries? Before: Memory usage: 2194.78MB (peak: 3077.39MB), time: 1324.69s After: Memory usage: 4542.54MB (peak: 4856.12MB), time: 232.66s

Yeah, seems like a bug "fix."

Re: Composer – Disable GC when computing deps and refs

#17
post #14

Wait, when did Github become the new 4chan?

It's much closer to reddit than 4chan, otherwise the nature of the images posted would be a little different.

And it's been like this for 2 or 3 years now. I've seen comment spam of images for commits and issues for quite a while.

Re: Composer – Disable GC when computing deps and refs

#18

As far as i understand composer is roughly the same thing as the cpan client. And they just simply disabled the garbage collector for it. What is this guy doing that he needs gigabytes of memory to install a bunch of php libraries? Before: Memory usage: 2194.78MB (peak: 3077.39MB), time: 1324.69s After: Memory usage: 4542.54MB (peak: 4856.12MB), time: 232.66s

Recursively gathering all dependencies a project might have. A huge downside of the modern scripting languages landscape is that dependency graphs can get quite convoluted

Re: Composer – Disable GC when computing deps and refs

#19

Could someone more versed with PHP, and this project explain why turning off garbage collection helped so much? and why they didn't turn it back on at the end of the function?

Garbage collection is slow, but reduces memory usage. So disabling it costs memory. Also, Composer does not keep running, once the job is done, the script terminates, so you don't have to enable GC back again (it's only disabled in the context of the current execution).

Re: Composer – Disable GC when computing deps and refs

#20

As far as i understand composer is roughly the same thing as the cpan client. And they just simply disabled the garbage collector for it. What is this guy doing that he needs gigabytes of memory to install a bunch of php libraries? Before: Memory usage: 2194.78MB (peak: 3077.39MB), time: 1324.69s After: Memory usage: 4542.54MB (peak: 4856.12MB), time: 232.66s

So, did they exchange a 70% reduction in execution time for a 100% increment in memory usage?
Post reply on HN