A note on framework performance
A question came up recently wondering why Slim Framework was around 5 times slower than plain PHP. All frameworks are by definition slower than no-code as there's more going on. i.e. an index.php of: <?php header('Content-Type: application/json'); echo json_encode(['result' => 1]); is going to be much faster than a Slim application with this code: use \Slim\App; include 'vendor/autoload.php'; $config = include 'Config/Container.php'; $app = new App($config); $app->get('/do-it', function($request, $response){ return $response->withJson(['result' => 1]); }); $app->run();… continue reading.