zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.29k stars 466 forks source link

Use zend_string* instead of char* to improve performance #1902

Open zhaoyanliang2 opened 5 years ago

zhaoyanliang2 commented 5 years ago

In php7, a lot of char is replaced by zend_string, this helps reduce memory allocation and hash calculations. This should also apply to zephir that is still heavily using char*. I have tried this, but it currently only works on php7.2 and php7.3. This is enough for me, I don't think I have time to finish the rest. If other people are interested, you can refer to my changes. zhaoyanliang2/zephir

sergeyklay commented 4 years ago

@dreamsxin What do you think about this? Can we start moving in this direction?

dreamsxin commented 4 years ago

@sergeyklay Using zend_string is very convenient when using Zend API.