3
horus
235d

So when you use array_reduce to reduce an array to another and take a plan array [] as Sees, you may emcounter a performance by motherfucking 300-1000 times slower then when you do it with a plain loop. I am not entirely misguided in how to program but trapped by another php fuckery, right? RIGHT?

src: https://github.com/php/php-src/...

Comments
  • 1
    Partially PHP, partially expected in any architecture.

    It's easy to overlook, but the comment is spot on from ILUU.

    My brain is currently a bit mushy, but you could trigger that same problem in Java or any other language.

    Using callbacks / anonymous functions / lambdas isn't bad... But it can create a whole lot of nightmares.

    Be it "on every count create a new list and toss it immediately" or a "no more garbage collection possible cause the reference to the object was lost" thing.

    Python has e.g. list comprehensions. Can be whole lot of good, but if someone just writes list comprehension s memory can go boom and it is sometimes unreadable gibberish.

    Sometimes... Just sometimes... The dumbest code is the smartest.

    Especially when it comes to code wanting to be smart. :-)
Add Comment