Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:51:10+00:00 2026-06-17T09:51:10+00:00

I understand from PHP exec() performance that running exec() creates an overhead but in

  • 0

I understand from PHP exec() performance that running exec() creates an overhead but in large programs or websites, wouldn’t it be beneficial to have parts of the backend written in another language, and have PHP call the program using exec?

For instance, I wrote/ran a test with a large amounts of string manipulation – PHP took 2.3s while Java took .52 and C++ took .33. The speed difference is already obvious. The time could be sped up even more if I multithreaded the operation. I also found that parallelism can be achieved in with something like

exec("./largeoperation > mydir/$dirname.data &"); 
//or
exec('java Backend > /dev/null 2>&1 &');

With all these benefits, other than the need to write code in another language, I fail to see why I shouldn’t relegate more parts of my backend to a faster program written in a different language. Also, I know of the existence of bridges like Working with Php-Java Bridge but I’m not sure if using that would be THAT much faster than simple exec(). Does anyone have any more details on exec()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:51:12+00:00Added an answer on June 17, 2026 at 9:51 am

    While you could farm work out to other programs using exec and friends, the thing you’re trying to do is best accomplished using a message queue system. A well-designed message queue will let you write worker programs in any language you need. They’re a great solution when you need to do something in another language, environment, or server.

    There are lots of message queues, but I’m a big fan of Gearman. It was built by the same folks that brought us memcached. Take a peek at the PECL extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
I found that Maven implies specific directory layout. But I don't understand from here:
From PHP.net: http://www.php.net/manual/en/function.pfsockopen.php I understand the gist of what this function accomplishes, but I'm
I'm moving from PHP to ASP.NET/C#. So far so good, but I don't understand
I am trying to pass a value from php to javascript. I understand one
As far as I understand from the documentation the QUdpSocket are async but, still,
I'm relatively new to ruby and i came from php. One thing that it
I have a JSON string (from PHP's json_encode() that looks like this: [{id: 1,
Coming from PHP I understand the difference in using == verses === in a
I'm looking for a PHP framework that supports CouchDB pretty well natively, I understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.