Porting PHP code to Zephir - when would that make sense?

Hi all,

I'm thinking whether porting parts of PHP code to Zephir does make sense - will it increase speed and lower memory consumption.

I know that the first answer will be "it depends", but let me ask you this.

Would let's say, Doctrine ORM rewritten in Zephir be faster than its PHP original?

Certain parts of my app are quite heavy on PHP (like a tandem of ACL & navigation rendering), so I'm thinking if it makes sense to do it in Zephir.


edited Sep '15

If you pay attention to variable types, most probably yes. But there are still two crucial things missing from Zephir imo: Variable references and the use keyword for lambda functions. That can make porting stuff quite cumbersome, and you may lose the edge memory-wise because of using wrapper classes... But I'm also curious what the devs have to say about it :)

It depends, porting too dynamic PHP code to an apparent equivalent version in Zephir usually does not bring any performance improvement to the table. Large codebases (like Phalcon) can show reductions in memory consumption due to all the summatory of micro optimizations available. What Zephir can offer you is type safe, improved static analysis and intellectual protection.