I want to use assembly code to handle some critical tasks concern with performance using PHP. How can I do this? I have searched before but nothing at all.
I believe you are talking about extending PHP.
You can do that by creating custom extensions in c language. A simple tutorial on how to do that you find here
Using assembly for your performance problems, is like using a sledgehammer to open a dam, while there is probably a lever somewhere, that opens the dam. Better look at your structure first and see why those critical tasks have performance issues and see if you can alter the strucure.
Besides that, as php is a scripting language that is interpreted on run-time, rewriting the code to C, like in the example from Udan gives 90% of the performance boost, rewriting the C code to assembly might add some extra 10%, but will take 90% of the time.
On the other hand, the argument you are using assembly in your code gives you some brag-rights, just up until the moment another programmer looks at your code, restructures it giving a 50% performance boost and completely bypasses your assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With