News for hackers. Stuff that matters.
Re:Pux – High Performance Router for PHP by rdlowrey on Sunday January 12, 2014 @02:00PM (#7047004)
The problem with this is you can accomplish essentially the same thing in userland if you know how to write a good "compiled regex" ... Calling the pcre functions in C land gains you very little. An extension is totally unnecessary.
Re:Pux – High Performance Router for PHP by pedro93 on Sunday January 12, 2014 @11:20PM (#7048890)
I don't think so.

Using pure PHP, you need to load a lot of class files. and function calls, method calls, hash find are pretty slow in pure PHP.

- First of all, while using C extension, you don't need to reload these php class files again and again. it reduces the class loading overhead.

- Seconds, looping and string comparison is pretty fast in C. it's because in pure PHP, it duplicates the string when calling functions/methods in the runtime.

- Third, there are a lot of spaces to optimize the code in C rather than in pure php.

- Last, pure PHP consumes a lot of memory, but in C extension, the memory footprint is pretty small.