discussion
Would you recommend this product?
It's simple and very easy to use
Awesome, I just found about it and already using it for a client's site. Clean, well organized and the MVC versión is just great!!!
Very impressive, I've starred it on Github.
Mychi Darko
Maker
I'm a full stack web developer@daniel_dewhurst thanks a lot😊
this is very good simply use thanks
Mychi Darko
Maker
I'm a full stack web developerit is sad but from my perspective php is doom. Major issue is the speed of development and language performance. only 1k/s requessts with index.php and "echo" but when using java (Spring) or nodeJs i get 15k and 5k.
Mychi Darko
Maker
I'm a full stack web developer@marcin_tribe pls contact me at mickdd22@gmail.com😉, let's see how we can address your issue
Ray LiMobile Developer @ NOCD Inc
@marcin_tribe PHP 7.3 is one of the fastest backends in performance benchmarks. Where did you get your results from?
@rayliverified I did it myself. I have compared netty, tomcat, jetty with apache (with different modes an caches) and nginx and I was shocked. That java (with SpringBoot+built in netty, tomcat) and nodejs (with express) is much faster. I later found some similar benchmark. I was writing nice framework for PHP 7.2 and left it because I couldn't tweak empty index.php to even meet 1/10 of "java" speed. Note: I heard that "go" is like 1.2 faster than java. So from that point PHP is no go for me. And for reference: my laptop is old (Intel© Core™ i5-4300U CPU @ 1.90GHz × 2 + 16GB Ram) and I easily (Springboot+netty without any config) run 15k/sec requests (simple text response) on spring boot.
Ray LiMobile Developer @ NOCD Inc
@marcin_tribe In my personal benchmarks, I find that I'm limited to 120 requests per second with PHP.
There's some interesting benchmark stats here: https://www.toptal.com/back-end/...
https://thinkmobiles.com/blog/ph...
I've been doing Android development for 8+ years but never used Java for a backend. Can you run a Loader.io and tell me how many requests Spring MVC is able to handle?
Ray LiMobile Developer @ NOCD Inc
@marcin_tribe Here's the best article I've found with real world server results: https://medium.com/@mihaigeorge....
You're right about PHP's RPS. I'm still very skeptical about the performance of other platforms. Are they really that much faster than PHP?
Mychi Darko
Maker
I'm a full stack web developer@ravi_babu1 All the information you need to create a stunning app or API is available at https://leaf-docs.netlify.com
Drew BrownDev
It seems extremely similar to Slim3.
Why not just use Slim3?
Mychi Darko
Maker
I'm a full stack web developerDrew BrownDev
@mychi_darko I see.
When I first looked at the code, it seemed to be so similar that it seemed to be copied.
I reviewed the code on the Leaf and Slim homepages:
https://leaf-docs.netlify.com // Slim http://www.slimframework.com
require_once __DIR__ . '/vendor/autoload.php'; // Slim require __DIR__ . '/../vendor/autoload.php';
$leaf = new Leaf\Core\Leaf(); // Slim use Slim\Factory\AppFactory; Slim $app = AppFactory::create();
$response = new Leaf\Core\Response(); // Slim use Psr\Http\Message\ResponseInterface as Response;
$request = new Leaf\Core\Request(); // Slim use Psr\Http\Message\ServerRequestInterface as Request;
// Leaf
$leaf->post('/books/add', function() use($request, $response) {
$title = $request->getParam('title');
echo $response->respond(["message" => "hello"]);
});
// Slim
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
$name = $args['name'];
$response->getBody()->write("Hello, $name");
return $response;
});
$leaf->run(); // Slim $app->run();
Next, I took a much closer look the libraries and the evolution of Slim.
I speculate that once Leaf has over 5 years of existence, over 100 contributors, and "the rest" of the code is filled in, and "the rest" of the best practices, it will look more like Slim. Are you just going to limit the code and functionality?
I'm not sure scalability is an issue with Slim. It's a dependency of SuiteCRM.
Can you give an example of how Slim impairs scalability?
I'm not sure speed is a concern with regard to PHP micro-frameworks in most use cases. Do you believe that if both Slim and Leaf were set up on a free shared host, for example, that the response would be dramatically different? Is "faster" merely a matter of reducing the lines of code? When developers add "the rest" of the code by including composer libraries or writing it themselves, do you believe the speed will still be faster?
What use case do you have in mind where speed matters (in the context of PHP 7+)?
Mychi Darko
Maker
I'm a full stack web developerMychi Darko
Maker
I'm a full stack web developerDrew BrownDev
@mychi_darko
How will Leaf be less like Slim (especially starting from code that is so similar to Slim)?
I would guess that as you get more contributors, they will want similar features to Slim and "pull" (pun intended) the codebase in that direction. How will you govern the project so that it is different than Slim? When I review the code of Slim, I don't see much there that is objectionable. What philosophy / vision will force Leaf to be "not-Slim"?
I also believe that Slim will slowly grow in size and functionality.
I am interested in vision of Leaf, in part, because I am developing a microframework. It's in PHP but not competitive or similar to Leaf or Slim. However, I review the code of microframeworks for inspiration.
I use Slim (at least because I use SuiteCRM). ;)
I could see using (and contributing to) Leaf in the future as well.
However, I must be able to defend the choice to use a lesser-known microservice.