Live data from Hacker News

Composer – Disable GC when computing deps and refs

github.com

31–40 of 135 posts

Re: Composer – Disable GC when computing deps and refs

#31

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?

Turning it on again it's currently being discussed: https://github.com/composer/composer/issues/3488

Re: Composer – Disable GC when computing deps and refs

#35

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, I wondered when They turn it on again.

Re: Composer – Disable GC when computing deps and refs

#36

Earlier quoted context omitted.

It seems when you start to hit the memory limit PHP's automatic garbage collection will loop through the constructed objects to see if any can be cleaned up. If none can (and in the case of Composer all the objects exist for a reason) then it's wasting time analysing the objects. So in this case there's only a large waste of cpu doing nothing with gc enabled.

Well, yes and no, since some of the reports show an increase in memory usage, so the gc was doing something.

Most reports don't show significantly changed memory usage though (some increase slightly, others decrease slightly).

Re: Composer – Disable GC when computing deps and refs

#37

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.

I think it's great too, but I shudder to think what it might look like 5 years from now. I can only figure that there will be dead gifs everywhere

Re: Composer – Disable GC when computing deps and refs

#38

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.

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.

           \/\/\/\/
         /         \
        /           \
       /             \
   /\_/     0    0    \_/\
  |                       |
   \/ \      |_|      / \/
       \             /
        \  \-----/  /
         \         /
          \_______/
            |   |

  Agreed. (MVP)

Re: Composer – Disable GC when computing deps and refs

#40
post #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?

1324 -> 232. If you say 70% reduction VS 100% increment sounds like you are talking the same stuff and it is possible to compare 70 with 100.

The reality is even in the above edge case: 2x memory, 6x speed.

Post reply on HN