Skip to content
Advertisement

Tag: generator

Why php generator is slower than an array?

According to comments from documentation: http://php.net/manual/en/language.generators.overview.php We can see that thanks to generators there is huge memory usage improvement (which is obvious), but there is also 2-3 times slower execution – and that is not so obvious to me. We gain memory usage improvement at the expense of time – which is not fine. So, why is php generator slower

Advertisement