Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-412

Move PHP stubs into C code and eliminate eval in request init hook

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.3.0
    • None
    • None
    • None

    Description

      At the moment part of the SDK written in PHP, but because we cannot mix php and C code in the extension, we do some trick: every time the PHP class updated, the special script (genphpfile.sh) executed to concatenate all the PHP files and render them into C header file as a char* literals. And then load them in the runtime. The only problem with this approach is that, there is no any other place to eval those strings except REQUEST_INIT hook in php extension, and this is a huge performance bottleneck (and users know about it already: https://forums.couchbase.com/t/performance-issues-with-loading-php-sdk-in-php-fpm/8348/7
      As one solution would be to keep everything as is, but improve generator so that it will generate classes in C (for example using https://github.com/nikic/PHP-Parser). Another appoach would be to get back to previous process, when we have PHP files only for autodocs and tests, and everything written in C.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            avsej Sergey Avseyev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty