Is it possible to pass the processing to Go from PHP?

We all know that php is very slow with text lines especially regexps. 5.6 well, at least things just the way.
For a project completely on the Go need a different web server and even a different architecture.
Is it possible to pass through exec() or any other crutches the processing lines to transfer the language quickly, and then to receive from him the finished result?
If not then maybe Go with Python might work, and how to arrange shipment <-> receive?
July 9th 19 at 11:24
4 answers
July 9th 19 at 11:26
Solution
July 9th 19 at 11:28
Solution
It really does not exist for PHP processing modules regular expressions in native binary code? Yes, this can not be.
Will be easier and more efficient on the order.
Well I even mention is not heard, there are all sorts of extensions With the specific task and sometimes extremely narrow values - alva8 commented on July 9th 19 at 11:31
: regular expressions 100% should be. - Weston98 commented on July 9th 19 at 11:34
: what you suggest is for when you want serious functionality to endure. and some regular season - looking for PHP module. can not be. - Weston98 commented on July 9th 19 at 11:37
July 9th 19 at 11:30
Solution
Suggest wonder you have so many text processing and it is so very slow? The fact that calling something exec'om and or through the proposed tov. ZeroMQ - thing is not free. There is a serious risk that the overhead of calling external programs will cover all benefits.

In other words, if you have it just accumulates a large pool of strings that can one package be transferred to external processing - there is a sense to be soared. But if your goal is to replace a bunch of scattered code preg_match'her (or whatever page) on its function, a "fast track" Go or Python ohms, not suggest.
I have a large pool of many millions of rows and each you have to check 86 regexps - alva8 commented on July 9th 19 at 11:33
Then, any queue (ZeroMQ, RabbitMQ) plus external processor on something quick. I'm not sure that Python will be much faster, so just take something and compiled multi-threaded (Go .NET, Java, C++ finally :)). - Weston98 commented on July 9th 19 at 11:36
: if you have only the regular season, then PHP uses the PCRE library is written in C. So most likely your regular PHP work and so very quickly. To check whether to throw a million rows between processes - first, check in two languages, the time in which it these regular season to a million lines of fulfills. - Weston98 commented on July 9th 19 at 11:39
July 9th 19 at 11:32
Solution
Why do something where-that to pass, then process for go/Python/whatever.

PHP-why here involved in this case? Instead of a win will get even slower solution, just harder twice.

Well, if you really want to make a mess, raise your GO a small web server which accepts http requests for processing and send back the queries from PHP.
With pleasure. Here's another to understand how a web server on the Go to raise )) - alva8 commented on July 9th 19 at 11:35
: https://golang.org/pkg/net/http/ - Weston98 commented on July 9th 19 at 11:38
: Ahah )) No thanks, really super, I month only this web server to learn how to make a will and die before reaching the app itself )) - Weston98 commented on July 9th 19 at 11:41
how are you going to GO write processing 86 regexps, if you can not go?)
In General, you probably freelansim.ru - alva8 commented on July 9th 19 at 11:44
: Well, just one thing to write a small handler for lines having only the necessary functions of the language and quite another your webserver )) - Rebeka.Kunze commented on July 9th 19 at 11:47
: the webserver is done in 10 lines, not counting the processing of the queries, which is your handler that you are going to write. - rickey_Swift commented on July 9th 19 at 11:50

Find more questions by tags PHP