Hacker News new | ask | show | jobs
by FranOntanaya 2126 days ago
> Manipulating complex data structures that are large

I do assume it's not the case, but one of the footguns with PHP is that assigning around large variables/arrays and triggering the copy-on-write can end building up the amount of duplicates of that data being kept alive. Pass by reference, unsets, generators and the like aren't used super often due to a lot of runs being small stateless requests, but sometimes they may be needed.

1 comments

We resorted to only giving PHP ready to transmute data, so it didn’t handle any of the manipulation unless it was straightForward based on our own criteria, but anything involving too much searching or filtering (yes I realize there are other problems here, but our scale was large enough that these problems had to be tackled piecemeal, and aren’t relevant beyond that for this discussion)

Ultimately I’ve had less issues with Python for this type of workload and is eventually where we moved.