Hello Everybody,

I am developing a php application that interfaces with an external
executable binary. The program is written in C++.
I open the program (say a.out) using proc_open. Write some command at
its stdin and fetch data stdout. Then close the program.

The timing of only "a.out" is
real 490ms
usr 160ms
sys 290ms

When I invoke it using proc_open in php-cli, the timing becomes
real 530ms
usr 50ms
sys 450ms

Look closely, the cpu time and the real elapsed time increases. I run
the php version from command line. As an apache handler this will
surly take more time.

My question is, how can I improve invoking this a.out? Is there any
best practice?

The command is something like
$ ./a.out --option value --option value < script.txt

The program a.out can not be converted in php unless I write an
extension. But this will need a lot of effort to write it in PHP.

Some of my ideas are,
1. Create a standalone multi-threaded server that calls a.out and php
calls that server.
2. Call a.out as a CGI and convert it that way.

Any ideas?

Shiplu Mokadd.im
My talks, http://talk.cmyweb.net

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to