Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP extension confusion

I had converted a MATLAB .m file into a exe file and had call it from php. But the execution time is veryy slow. So, now I am thinking of converting the matlab file into C.

Can I call the converted C file from PHP extension?

Do I need to first convert the matlab program into C and then call it from the php extension or I should convert the matlab program in C in PHP itself?

Will the execution time will be faster than before or will be the same?

like image 629
user1583647 Avatar asked Mar 21 '26 17:03

user1583647


1 Answers

You can possibly acquire some bechmarks to help choose which path to take.Can you execute the matlab and exe file manually? if so, how long do they take to execute?

I think that you have three options:

1) whatever the matlab file is doing, rewrite it in PHP. Execute the php and compare with the benchmarks above.

2) research the mechanism that you are using to execute the matlab exe file and see if it can be streamlined... are you using exec()?

3) convert & compile the matlab file into C and use the exec() mechanism, if available for your platform (Windows?) and compare to the benchmarks above. Can you describe how it is currently being executed?

Hope this helps!

like image 184
Mitayai Avatar answered Mar 23 '26 05:03

Mitayai