Skip to content

Core optimisation, introduction of generic FastCGI request object

Compare
Choose a tag to compare
@AndrewCarterUK AndrewCarterUK released this 26 Aug 22:03
· 135 commits to master since this release

After profiling the application under load it became clear that one of the bottle necks slowing down the performance was the instantiating of the PSR-7 server request message objects. It is possible that using a library other than Zend Diactoros to create these objects would have increased the performance of the daemon, however possibly at a quality cost. In the case of the adapters to the Symfony and Silex framework, it made no sense having them tuned to PSR-7 server request message objects, only for them to be converted to the corresponding HttpFoundation object before being consumed. As the message received by the FastCGI daemon is simple, it makes far more sense to leave this message in an object that represents the state and format it was received in - and then provide the functionality for alternative representations if required.

As a result, the KernelInterface has now changed to accept only FastCGI request objects (but methods exist on these objects to create PSR-7 or HttpFoundation objects). The KernelInterface can return either PSR-7 or HttpFoundation responses.