-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spike] Performance benchmark #534
Comments
I'd also like to see Sails and Strapi included in the benchmark. |
We can leverage https://github.com/bajtos/async-frameworks which I build for my NodeConf.eu talk. |
I added LoopBack 3.x and 4.x to my async-frameworks benchmark, see bajtos/async-frameworks#1. The results are encouraging. Express can handle In other words, LoopBack 4.x has about 10% lower throughput and adds 20% more latency compared LoopBack 3.x. I this find acceptable for the first GA release. To better understand the picture, if we were refreshing a screen on every request, we would be limited to 312 fps with LoopBack 4.x. That's way more that most clients apps (native or HTML5) can achieve. |
In #1583, I wrote a benchmark comparing the performance of The results have surprised me - the create operation is ~10x slower than reading. To investigate this further, I am thinking about writing another quick benchmark to measure how fast juggler can find and create records. I hope it will show that juggler is the slow part, not loopback-next. |
That's interesting ... I'm curious to see the results of the isolation tests for juggler vs. loopback-next. Possible overhead I can think of is the request / response context creation? While it's acceptable for LB4 to be slower -- I think it's important for us and our users to know where the bottlenecks lies and this may be a factor for anyone looking to move from 3.x to 4.x Maybe you can use node clinic to see where the slow down comes from? |
Actually it was pretty easy to find the biggest source of slow down. Our request-body validation implementation does not
My conclusion is that for 4.0 GA, we need to improve our request-body validation to cache pre-compiled AJV validations. With that change in place, the performance will become acceptable. Thoughts? |
I have created a follow-up issue to optimize AJV validations: #1590 |
Closing as done. |
We should run at least a basic performance benchmark to understand how are we doing in comparison to LoopBack 3.x, but also competitors like Hapi, Express and Fastify.
Depending on the outcome, we may want to plan some time to fix low-hanging fruits.
UPDATE (2018-06-21)
The scope for 4.0 GA:
A high-level benchmark to know what our performance is. Use our Todo application with in-memory storage, measure throughput for the following request: get a list of todos (a simple read-only query), create a new todo without geo location (validations!).
UPDATE (2018-02-22)
Timeboxed to 2 weeks
Based on discussion with @raymondfeng @kjdelisle :
Acceptance Criteria (no longer relevant)
Follow-up stories (spike outcome)
The text was updated successfully, but these errors were encountered: