digiaonline / graphql-php

A PHP7 implementation of the GraphQL specification.
https://facebook.github.io/graphql/
MIT License
217 stars 10 forks source link

Make the mbstring extension a hard requirement #247

Closed Jalle19 closed 6 years ago

Jalle19 commented 6 years ago

I made a simple API using this library and deployed it to both Heroku and a server on UpCloud. In both cases, performance was abysmally bad - on Heroku each GraphQL request consistently took over 10 seconds while on UpCloud they were closer to 5 seconds.

After install the mbstring extension, the response time on UpCloud dropped to 25 ms.

Jalle19 commented 6 years ago

We should either do this or we should carefully go through every place we use mb_ functions and consider whether we really need to support multi-byte.

Jalle19 commented 6 years ago

time ./vendor/bin/phpunit with mbstring enabled:

OK, but incomplete, skipped, or risky tests!
Tests: 841, Assertions: 1597, Incomplete: 2.

real    0m5.882s
user    0m5.863s
sys 0m0.020s

Without:

OK, but incomplete, skipped, or risky tests!
Tests: 841, Assertions: 1597, Incomplete: 2.

real    2m23.197s
user    2m23.145s
sys 0m0.040s