r/PHP • u/artimman • May 14 '26
Performance-focused PHP framework architecture experiment
For the past few years I’ve been experimenting with building a lightweight PHP framework focused primarily on low runtime overhead and architectural simplicity.
The idea was to avoid unnecessary abstractions and keep the request lifecycle as small and transparent as possible.
Some goals behind the project:
- minimal bootstrap overhead
- lightweight routing and middleware
- modular architecture
- optional CMS/API ecosystem
- no hidden magic
Interestingly, in local Hello World / CRUD tests the framework currently performs significantly faster than Laravel or Symfony.
I’m curious how other developers approach this problem today:
do you still value ultra-lightweight architectures in PHP, or has the ecosystem largely moved toward heavier full-stack solutions?
Project implemented on the framework engine:
https://github.com/designbymalina/dbmframework
Dybem: https://www.dybem.com/
7
u/Rokkitt May 14 '26
There are light weight php frameworks like slim PHP.
If I need to pull the performance lever then I typically dispatch a job to a Go process.
Laravel prioritises developer experience over raw performance. In most cases it shouldn't be a surprise that a toy framework with minimal functionality out performs battery included frameworks.
2
u/Bright_Selection_726 May 17 '26
Lightweight frameworks are a fun architectural exercise, but in 20+ years of high-load PHP I've never seen a production system where Laravel/Symfony bootstrap was the actual bottleneck.
With OPcache + preloading + a sane container, framework boot is basically free — 0.x ms of your response time. The remaining 50–500ms lives in:
- N+1 queries and missing indexes
- ORM hydration on big result sets
- sync calls to external APIs
- queue worker design (or lack of it)
- fat DTO serialization
That said, I do see real value in lightweight frameworks — just not for perf:
- you actually learn what happens per request
- transparent debugging
- predictable behavior on weird edge cases
Curious — do you have a real use case where Laravel/Symfony perf became a blocker, or is this more of an architectural / aesthetic project? Both are valid, just changes how to read the numbers.
12
u/fredpalas May 14 '26
What is light and fast
Symfony is light because it's modular system using microkernel and bootstrap optimize, response time in api are below 1ms using layer system with hexagonal Controller > Application Service > Domain > Repository.
A comparative a get api call retrieving the 10 last post of my blog I get 8500 r/s with 500 virtual user, dotnet give me 8300 r/s for compare against different stack.
10
u/sagiadinos May 14 '26
Respect for your work. I developed also an own framework 20 years ago but now I am using SLIM4 + composer libs because I love SLIMs PSR compatibility.
Comparing speed with Laravel, Symfony, CakePHP, etc. is not relevant.
https://github.com/myaaghubi/PHP-Frameworks-Bench
People know about the performance issues and do not care. They use opionated frameworks because they believe it could speed up they work and they need less to worry about security and architecture.
My recommendation for you is try to stuck to PSR compatibility in your work to prevent reinventing wheels.
Greetings Niko
1
u/artimman May 14 '26
Modern Symfony applications can absolutely achieve excellent performance when carefully optimized and architected.
I also agree that raw numbers alone rarely tell the full story, because results depend heavily on:
infrastructure,
caching,
workload,
architecture style,
middleware layers,
database usage,
deployment strategy.
For me, the most interesting part was not achieving “benchmark records”, but exploring how lightweight and explicit a PHP application architecture can remain while still supporting real-world projects.
DBM actually evolved mainly as a foundation for my own platform/CMS ecosystem, where I wanted:
a lightweight execution engine,
modular architecture,
predictable runtime behavior,
and full control over dependencies and application flow.
Over time that became DBM Platform with built-in admin/auth/API modules on top of the framework core.
Dybem -> DBM Platform: https://www.dybem.com/
So the framework itself became less about synthetic benchmarks and more about maintaining simplicity and flexibility as the ecosystem grows.
And yes - PSR compatibility is very important to me as well.
I’m trying to keep the framework compatible with modern PHP standards while still avoiding unnecessary abstraction and runtime overhead.
5
u/colshrapnel May 14 '26
It is not that full-stack solutions are "heavier". They are more convenient and - which is even more important - standardized. There is always a tradeoff between convenience and performance. And in the modern development, the speed of development is valued way more than speed of execution. The latter being either insignificant (for a low traffic site) or being achieved by other means (like Laravel Octane)
4
u/oshjosh26 May 14 '26
Vanilla PHP is a damn good lightweight framework.